THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline

#1 Template Inhertitance

(14-05-2024 17:10:47)


"Template inheritance is available from Thelia 2.4. You can now create a new template, and redefine only the required files instead of copying the whole template."

I have created a new folder under templates/frontOffice.  It appears I have to copy all files from the default folder instead of being able to add just the files I want to change. I'm using 2.5.4 so I thought I should be able to only create the required files.

Offline

#2 Re: Template Inhertitance

(14-05-2024 21:15:23)


Did you created a template.xml file in your template folder ?


OpenStudio Toulouse

Offline

#3 Re: Template Inhertitance

(15-05-2024 03:06:26)


I copied the default template directory and selected this template as the front office template in the admin panel.  When I started removing files from the new directory I get 404 errors instead of displaying the default templates.  The template.xml file is in the new template directory.

Offline

#4 Re: Template Inhertitance

(16-05-2024 11:41:42)


In the template.xml, you should declare the parent of your template.

For example, if your template extends the "default" template :

<?xml version="1.0" encoding="UTF-8"?>
<template xmlns="http://thelia.net/schema/dic/template"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://thelia.net/schema/dic/template http://thelia.net/schema/dic/template/template-1_0.xsd">
    <descriptive locale="en">
        <title>My template</title>
    </descriptive>
    <parent>default</parent> <!-- declare the parent here -->
    <languages>
        <language>en_US</language>
    </languages>
    <version>1.0.0</version>
    ...
</template>

OpenStudio Toulouse

Offline

#5 Re: Template Inhertitance

(16-05-2024 15:41:38)


Thank you.  That solved the problem.