0

I've recently started making a website using the X-Cart platform.

I've read some of pages from the official documentation, but a lot of things do not match the current version of X-Cart (5.3).

From what I understand, they switched from Smarty to Twig, but the file locations and hierarchy have changed as well. Even the database structure is modified and old tables don't have the same names.


I'm currently trying to entirely replace the header / footer of my website. The HTML files are included in lists and displayed with twig, but I don't know how to find those specific files.

Also, I've used the Webmaster Kit add-on in order to find the templates. The problem is that every single element displayed on the page is built from multiple places. Most of them can be found in /customer/layout/, but are part of lists such as layout.header, so the twig files only include the wrappers and retrieve the rest of the code from the database, at least that's my understanding of the situation.

 {##
 # Header logo
 #
 # @ListChild (list="layout.header", weight="100")
 #}
<div id="{{ this.getUniqueId('logo') }}" class="company-logo">
  <a href="{{ url() }}" title="{{ t('Home') }}" rel="home"><img src="{{ this.getLogo() }}" alt="{{ t('Home') }}" /></a>
</div>

I tried accessing layout.header through my database, but the table shown in the documentation doesn't exist anymore.

Could someone please explain the hierarchy and guide me through the steps to create a custom header / footer ?

I did create my costum module, but I still don't know which files are the right to edit in order to make changes happen on my website.

Thank you, let me know if you need additional details.

1 Answers1

0

The header section is defined by the skins/customer/layout/header/main.header.twig template or you can just assign all needed templates to layout.header view list and it will have the same effect. You may also want to remove existing templates and viewer classes from this list.

All these procedures are explained here:

If you want to look up what templates and viewer classes are in the list, then you can run following MySQL query:

SELECT * FROM xc_view_lists WHERE list="layout.header";

As for footer, the layout.footer defines this area or just override the skins/customer/layout/footer/main.footer.twigtemplate.

Hope, it helps.

Tony

Tony
  • 149
  • 5