RSS

Knowledge Base / Datatypes / How to render values from...

How to render values from Page meta types

Submitted Jun 06, 2008 by Pavlo Kuzminskyi

This article describes how you can render the value on a page if you have created a Page Meta Type. We will be using the XSLT function to do this.

 

1.   Go to Administration part | Data 

2.   Add new Page Meta type with such parameters:

Settings tab:

Name: the function should be called intuitive understanding like "Marker"

Namespace: the namespace should display function’s purpose like "Metatypes"

Fields:

Name: “MarkerValue”,

Label:Marker Value”,

Field type: String,

String maximum length: 64 character maximum. 

3.   Save your Metatype. 

4.   Go to Administration part | Content 

5.   Click/right click Add Meta Data Field and add your created metatype:

Settings tab:

Marker Value: Sample Value of Marker

6.   Press “Save” button

7.   Go to Administration part | Functions 

8.   Add new XSLT function with following parameters:

Settings tab:

Name: the function should be called intuitive understanding like "MarkerRendering"

Namespace: the namespace should display function’s purpose like "Metatypes.Marker"

Description: function description

Output type: should be "XHTML"

Input Parameters

·      Add new parameter “Filter”

·      “Parameter type” should be Expression<Func<XXX,Boolean>> (where XXX is the name of your type)

·      “Test value” should be <Your namespace> | <Data type name> | DataReferenceFilter  and in Data Reference list should be selected some element

·      “Default value” should be <Your namespace> | <Data type name> | ActivePageReferenceFilter or other

Function calls

·      Add new function “ <Your namespace> | <Marker> | Get<Data type name>Xml”

·      Click on “Filter”:

      Parameter value type: should be “Execute a function call“

      Complex function call: should be “Composite | Utils | GetInputParameter” with parameter name “Filter”

Template

      Copy and paste code into the <body></body> tags:

Value of input parameter 'Marker': <xsl:value-of select="/in:inputs/in:result[@name='GetMarkerXml']/Marker/@MarkerValue" />

 

Preview

In Preview you can see filtered data.

 

9.   Save changes

10.  Edit Page

11.  At content area click/right click on Insert button/link  | Functions | select created functions

12.  Press “OK” button

13.  Save changes 

 
or cancel