Jump to content


Photo
- - - - -

Adding template layouts to item types

documentation template item layout type

  • This topic is locked This topic is locked
No replies to this topic

#1 Kess

Kess
  • JBZoo User (rus)
  • User rate: 11.9
  • posts: 406
  • topics: 40

Posted 12 September 2013 - 12:57

As you might have noticed, some item types have more template layouts than others. In this article we'll describe how to add more templates to the item type of your choice.
 
In this example we'll be adding "Favorite" template to the "Demo element" item type.
 
1. In the folder
media/zoo/applications/jbuniversal/templates/catalog/renderer/item
copy favorite.php to the "demo-elements" folder.
 
ssm59c150d7_200x0.png
 
2. Open 
media/zoo/applications/jbuniversal/templates/catalog/renderer/item/demo-elements/metadata.xml
and add this code to "metadata":
<layout name="favorite">
   <name>Favorite</name>
   <description>Layout for element favorite</description>
</layout>
3. Open
media/zoo/applications/jbuniversal/templates/catalog/renderer/item/demo-elements/positions.xml
and add this code to "renderer":
<positions layout="favorite">
   <position name="title">Title</position>
   <position name="image">Image</position>
   <position name="properties">Properties</position>
   <position name="text">Text</position>
   <position name="meta">Meta</position>
</positions>
You can change or add new positions but be sure to accordingly edit favorite.php in order to include new positions there.
 
 
4. After this, configure your new template layout like any other:
 
Click on its name

ssmf6fd71a0_200x0.png
 
Add needed elements to their positions
 
ssmac9046b9_200x0.png

Edited by SmetDenis, 13 September 2013 - 12:43.

  • 1





Also tagged with one or more of these keywords: documentation, template, item, layout, type

Click to return to top of page in style!