|
<<prev |
1 |
2 |
3 |
4 |
5 |
6 |
next>>
RealCart Tag Syntax - The Basics
The object of this course is to directly expand on what you learned in the last course, RealCart Tags 101 with the rules governing proper syntax. While it is probably not necessary for everyone that customizes RealCart to customize on the level of varying the tag syntax, like we will learn here, some RealCart power users may insist on knowing.
Repeat Tag Syntax
As discussed on this page in the previous course the Repeat Tags can repeat a portion of code once for each item in a dataset. The basic repeat tag looks something like this:
[DepartmentGroupsLoop_Begin;DepartmentID=%DepartmentID]
and
[DepartmentGroupsLoop_End]
You will notice that after DepartmentGroupsLoop_Begin in the top tag above there is a semicolon (;) before DepartmentID=%DepartmentID. The semicolon that separates DepartmentGroupsLoop_Begin and DepartmentID=%DepartmentID tells RealCart to simply repeat everything in between the Begin and End tags.
Dealing with Comments
In some cases the repeat tags will be enclosed in comment tags <!-- and -->. This is a potential problem because we do not want comment tags repeated, only what is between them. In such a case we do not want the --> portion following the beginning repeat tag to be repeated, nor do we want the beginning repeat tag <!-- before the end repeat tag to be repeated. By using the (>) symbol in place of the semicolon (;) above we can avoid repeating the comment tags themselves and repeat only what is between these comment tags. To illustrate this the parts that do not get repeated when using (>) are highlighted in red/yellow below:
<!-- [ProductFeaturesLoop_Begin>ProductID=%ProductID] -->
Everything in between these tags except the end comment tag above and the begin comment tag below (both in red) will repeat. This includes all of this text in navy blue.
<!-- [ProductFeaturesLoop_End] -->.
Sometimes it is necessary to enclose tags like this in comments so editing the templates with a WYSIWYG editor will ignore the comments and leave them intact. (If they werent shielded in between comment tags they could become corrupt by such editors.)
Just remember that the character in the middle of the beginning repeat tag will determine whether or not comment tags are present and to ignore them. Semicolon (;) will repeat everything between repeat tags, while the right angle bracket (>) will repeat everything except the repeat tags themselves.
[DepartmentGroupsLoop_Begin;DepartmentID=%DepartmentID]
repeats everything.
[DepartmentGroupsLoop_Begin>DepartmentID=%DepartmentID]
repeats everything except the beginning and ending comment tags.
<<prev |
1 |
2 |
3 |
4 |
5 |
6 |
next>>
|