View Single Post
  #5  
Old 06-20-2017, 01:56 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Using ListChild weights to reorder templates

Think of lists as of placeholders where templates and classes can add themselves into with the @ListChild directive.

List names doesn't match with HTML source tags directly. I.e. "body" and "head" are not the HTML tags, but just names.

For example, here is the skins/customer/header/body.twig template:
Code:
<head{% for k, v in this.getHeadAttributes() %} {{ k }}="{{ v }}"{% endfor %}> {{ widget_list('head') }} </head>
This template renders the "head" HTML tag and lets other templates and classes inject their code inside it by using @ListChild (list="head", weight="SOME_VALUE") declaration.

As Steve said, the higher the weight the lower the widget/template is in the list. So, to understand what weight you should specify for your template you are to search for other classes/templates using the same list name in their @ListChild directives and check their weights.

By adjusting the weigh you can move your templates/classes inside the list.

However, you must not edit source files of X-Cart or modules created by other developers. To move classes/templates that were created by other developers, you should create a custom module and use the methods like moveTemplatesInLists(). Here is a good tutorial on using these methods by Mike White:
http://xcartguru.com/knowledge-base/x-cart-5-kb/x-cart-5-moving-classes-and-templates-in-lists/


Hope this helps!
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote