Jump to content

Edit History

danielsaar

danielsaar

Hi to all,

I would like to expand the question from ArthurA.

Here we have a documentation about child-things : https://devdocs.prestashop.com/1.7/themes/reference/template-inheritance/parent-child-feature/

But it is without examples.

I did understand, when I copy this: templates/catalog/listing/category.tpl, the Presta will use "only" the code inside category.tpl.

The rest of the documentation is not clear.

If I like to extend the "category template" (the text before talks about category template) I have to extend it with:
{extends file='catalog/listing/category.tpl'}

Why there is instead: {extends file='catalog/listing/product-list.tpl'} ?

Later in the text we find this: {extends file='parent:catalog/listing/category.tpl'}

and "and define just the block you need".

What is the meaning of "and define just the block you need".

For example: in the File category.tpl is nothing but the string HALLO WORLD,

where on the Page I will find this "HALLO WORLD" later?

Is it before the the original - code in the category.tpl or after?

The content of the category-File (Classic Theme) on my server is:"

{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
    {include file='catalog/_partials/category-header.tpl' listing=$listing category=$category}
{/block}"

 

Ok, now I like a "HALLO WORLD" after the first closing }

I would copy the category.tpl - File to my Child and there I would put the String like:

{extends file='catalog/listing/product-list.tpl'}HALLO WORLD

{block name='product_list_header'}
    {include file='catalog/_partials/category-header.tpl' listing=$listing category=$category}
{/block}"

..

How I can extend the category.tpl in the same way and not copy the category.tpl?

I need to "say the code" where I want to put the "HALLO WORLD" - String.

Did I misunderstood something?

Thank you and greetings
Daniel

 

 

 

danielsaar

danielsaar

Hi to all,

I would like to expand the question from ArthurA.

Here we have a documentation about child-things : https://devdocs.prestashop.com/1.7/themes/reference/template-inheritance/parent-child-feature/

But it is without examples.

I did understand, when I copy this: templates/catalog/listing/category.tpl, the Presta will use "only" the code inside category.tpl.

The rest of the documentation is not clear.

If I like to extend the "category template" (the text before talks about category template) I have to extend it with:
{extends file='catalog/listing/category.tpl'}

Why there is instead: {extends file='catalog/listing/product-list.tpl'} ?

Later in the text we find this: {extends file='parent:catalog/listing/category.tpl'}

and "and define just the block you need".

What is the meaning of "and define just the block you need".

For example: in the File category.tpl is nothing but the string HALLO WORLD,

where on the Page I will find this "HALLO WORLD" later?

Is it before the the code in the category.tpl or after?

The content of the category-File (Classic Theme) on my server is:"

{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
    {include file='catalog/_partials/category-header.tpl' listing=$listing category=$category}
{/block}"

 

Ok, now I like a "HALLO WORLD" after the first closing }

I would copy the category.tpl - File to my Child and there I would put the String like:

{extends file='catalog/listing/product-list.tpl'}HALLO WORLD

{block name='product_list_header'}
    {include file='catalog/_partials/category-header.tpl' listing=$listing category=$category}
{/block}"

..

How I can extend the category.tpl in the same way and not copy the category.tpl?

I need to "say the code" where I want to put the "HALLO WORLD" - String.

Did I misunderstood something?

Thank you and greetings
Daniel

 

 

 

danielsaar

danielsaar

Hi to all,

I would like to expand the question from ArthurA.

Here we have a documentation about child-thinks : https://devdocs.prestashop.com/1.7/themes/reference/template-inheritance/parent-child-feature/

But it is without examples.

I did understand, when I copy this: templates/catalog/listing/category.tpl, the Presta will use "only" the code inside category.tpl.

The rest of the documentation is not clear.

If I like to extend the "category template" (the text before talks about category template) I have to extend it with:
{extends file='catalog/listing/category.tpl'}

Why there is instead: {extends file='catalog/listing/product-list.tpl'} ?

Later in the text we find this: {extends file='parent:catalog/listing/category.tpl'}

and "and define just the block you need".

What is the meaning of "and define just the block you need".

For example: in the File category.tpl is nothing but the string HALLO WORLD,

where on the Page I will find this "HALLO WORLD" later?

Is it before the the code in the category.tpl or after?

The content of the category-File (Classic Theme) on my server is:"

{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
    {include file='catalog/_partials/category-header.tpl' listing=$listing category=$category}
{/block}"

 

Ok, now I like a "HALLO WORLD" after the first closing }

I would copy the category.tpl - File to my Child and there I would put the String like:

{extends file='catalog/listing/product-list.tpl'}HALLO WORLD

{block name='product_list_header'}
    {include file='catalog/_partials/category-header.tpl' listing=$listing category=$category}
{/block}"

..

How I can extend the category.tpl in the same way and not copy the category.tpl?

I need to "say the code" where I want to put the "HALLO WORLD" - String.

Did I misunderstood something?

Thank you and greetings
Daniel

 

 

 

×
×
  • Create New...