View Single Post
  #8  
Old 08-01-2017, 01:57 AM
  xplorer's Avatar 
xplorer xplorer is offline
 

X-Cart team
  
Join Date: Jul 2004
Posts: 925
 

Default Re: How to Display Product Attributes in a New Tab

Quote:
Originally Posted by johngwms
Can you please explain how lists work and what they are used for?

Think of "view lists" as named placeholders.

For example, in one of your templates you know that there is a place where some information is going to appear, but you can't say upfront what the information is.

So, in your Twig template, you add something like this:
Code:
{{ widget_list('product.details.page.tab.description.file-attachments', product=this.product) }}

"product.details.page.tab.description.file-attachments" is the name of that list.

Later, when you want to make some other template displayed in that place, you add the following code to that template:
Code:
{# @ListChild (list="product.details.page.tab.description", weight="50") #}

The "weight" parameter determines the order in which the list will render templates. The higher the value, the lower the template will be rendered in the HTML code.

This way your custom modules can inject custom HTML code into existing "view lists" without editing core template files where these lists are defined.

Last edited by xplorer : 08-01-2017 at 01:59 AM.
Reply With Quote