View Single Post
  #1  
Old 06-15-2017, 03:22 PM
 
plumstripe plumstripe is offline
 

Member
  
Join Date: Sep 2016
Posts: 11
 

Default Using ListChild weights to reorder templates

I understand that changing the weight attribute of listChild changes the order of templates or file contents.
By this I mean a file with this in:
# @ListChild (list="body", weight="500")
places the contents of the file somewhere in the body code.

But although there are many posts that mention using ListChild weight, and giving different weight values, I can't see an explanation anywhere of how the weights actually work.

For instance, if I change the weight from 500 to 300, will that move something up or down in the ListChild list? ie does an item with a weight of 500 come before one with a weight of 300? or the other way round?

What value weight do I need to place a piece of code directly below the opening body tag? Or below a certain other template?

Can I use weights to move things up and down in the <head></head> section of the html by changing the weight in the following:
# @ListChild (list="head", weight="500")

I find X-cart documentation has many examples, but no clear documentation of how attributes such as 'weight' work, or say, a list of the values one might substitute for xxx in @ListChild (list="xxxx", weight="500")

If you just give people examples, without actually explaining what's going on, you're just giving your users a fish, and not teaching them how to fish - ie it's hard to know how to adapt the examples for another use.

Thanks.
__________________
5.3.1.3
Reply With Quote