Перейти к содержимому

- - - - -

Adding template layouts to item types

documentation template item layout type

  • Закрытая тема Тема закрыта
В этой теме нет ответов

#1 Kess


Отправлено 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
copy favorite.php to the "demo-elements" folder.
2. Open 
and add this code to "metadata":
<layout name="favorite">
   <description>Layout for element favorite</description>
3. Open
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>
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

Add needed elements to their positions

Сообщение отредактировал SmetDenis: 13 September 2013 - 12:43

  • 1

Темы с аналогичным тегами documentation, template, item, layout, type

Click to return to top of page in style!