Related Tags Face

What is Face Tags?

face Mechanisms is the first step in general rendering mechanism which affect output production. Face tag refers to the groups of tags which is used by programmer to produce the final HTML code under some conditions.


Suppose we plan to show time in the output. we use the print command To do this as follows:
< basis core="print" datamembername="cms.value3"
The output of the above command will be as follows:
20:20:13
This example is the simplest form using the print command. Now, imagine we want this value to be within a <div> in our output:
<div>
<basis core="prinrt" datamembername="cms.value3"/>
</div>
This way we can provide the desired output but if command does not work by using the condition mechanisms in some cases, The <div> tag will be shown in The output. Because This tag is located out of the main <basis >. to solve this problem we Can use face.</div>
This enables you to format your output. Now see the above code using face:
<basis core="print" datamembername="cms.value3"
<face>
<div> @col1</div>
</face>
</basis>
Face tag is used as a print command child element and a <div> tag with @ col1 content is inserted. Whatever <face> tag will be applied in the output. There are some Key phrases that gives you the possibility to manage output. These phrases all begin with @. You know that all <member> in data sources return results in table format, So you can accsses to the data by using the column name </div>
You can access a specific column of a table (the current line) in two ways:

• Column name @{ColumnName} like @id، @name or @type
• Column index @col{index} like @col1، @col3

If you use the conditional mechanisms applied in cases not provided command the <div> is not shown in the output. By the way this is not the only use of <face> and we continue by describing face with filter. Suppose that you want data on the member's name db.test by a command list to be printed in output. We mean the HTML filewhen we say The output and for printing we mean placement of tags in the HTML document
<basis core="list" datamembername="db.test">
<face>
@col1 - @name
</face>
</basis>
Db.test table has two columns named id and name. The output of the above command is as follows:
4 - alian
12 - Tina
40 - Rose
Now suppose we want to display a record with a specific feature and tag set. For example, we deside to put a record with id = 12 inside the tag <span />. To do so, you can set your desired tags in the form of a face to the command list (or any other processor command) and using the filter feature on the face specify the way you want the conditions to be applied.</div>
< basis core= list datamembername= "db.test">
< face filter="@col1 = 12">
<span> @col1 - @name </span>
</face>
<face>
@col1 - @name
</face>
</basis>
The output is like this:
4 - alian
<span>12 - Tina </span>
40 - Rose
One of the important things about filter is the proiority. Note that face rendering priority is from top to bottom, so if you put face tag which include filter after a normal face tag, it would not work. You have to put filter on the top. To see details please check the filter.
Syntax
basis core=["command type"] datamembername=["your datamembername"] >
< face >
.
.
.
.

< /face>
< /basis>
Simple example
This example is the simplest form using the print command. Now, imagine we want this value to be within a <div> in our output:
< basis core="print" datamembername="cms.value3" >
< /basis>
Example With Filter
< basis core="print" datamembername="slider.list1" >
< face filter="rownumber=1" >
< div >
< div >@name < /div >
< div >@description < /div >
< /div >
< /face >
< face filter="rownumber=2" >
< div >
< div >@name < /div >
< div >@description < /div >
< /div >
< /face >
< /basis >
Example With Level
< basis core="view" datamember name=["your datamembername"] >
< face level=" 1" >
< div >
< div > @question </div>
@child
</face >
< face level ="2" >
< div > @ answer </div>
< /div >
< /face >
< /basis >
Example With Row Type
< basis core="print" datamembername="slider.list1" >
< layout >
<div>
@child
< /div > < /layout>
< face rowtype="even" >
< div> < img src="@image">
</div>
< div >
<p> @description</p>
</div>
< /face >
< face rowtype="odd" >
< div> < img src="@image">
</div>
< div >
<p> @description</p>
</div>
< /face >
< /basis >