Adding template layouts to item types

6.0/10 rating (1 votes)

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.

    Copying layout

  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

    Opening item template layout for editing

    Add needed elements to their positions

    Configuring item template layout

Template

Still gotta questions, who can help me?

Visit our special JBZoo tech support forum which is specifically meant for JBZoo so the priority of the response and its promptness are much better there than in any other place. With inactive account with a “Plus” sign in a tariff plan you can ask for support in one of these sections or use any of our contacts.