Joomla - 方便的模板升级

Joomla - Convenient Template Upgrades

我最近将一个网站从 Jekyll 迁移到了 Joomla(目前是 3.9)。因此我制作了自己的 Joomla 模板。它已经投入生产,但当然会定期更新。我使用非常标准的 development/release 方法,如 1.1、1.2、1.2.1 等版本控制。这些数字在 templateDetails.xml 中始终是最新的。到目前为止没有什么特别的。但这有一些非常不方便的问题:

编辑:按照 Irfan 的要求,这是我当前的 templateDetails.xml

<?xml version="1.0" encoding="utf-8"?>
<extension version="3.8" type="template">
    <name>####</name>
    <creationDate>2018-11-03</creationDate>
    <author>####</author>
    <authorEmail>####@####.de</authorEmail>
    <authorUrl>https://###.##.##</authorUrl>
    <copyright>SV FOO BAR e.V.</copyright>
    <license>TBA</license>
    <version>0.4.0-SNAPSHOT</version>
    <description>Joomla-Template fuer die Vereinshomepage des SV FOO BAR e.V.</description>
    <files>
        <filename>index.php</filename>
        <filename>templateDetails.xml</filename>
        <filename>template_preview.png</filename>
        <filename>template_thumbnail.png</filename>
        <filename>main.css</filename>
        <filename>favicon.ico</filename>
        <folder>images</folder>
        <folder>html</folder>
        <folder>language</folder>
        <folder>js</folder>
    </files>
    <positions>
        <position>breadcrumb</position>
        <position>left</position>
        <position>right</position>
        <position>footer</position>
    </positions>
    <languages folder="language">
        <language tag="de-DE">de-DE/de-DE.tpl_svFOOBAR.ini</language>
    </languages>
    <config>
        <fields name="params">
            <fieldset name="advanced">
                <field
                    name="sitedescription"
                    type="text"
                    label="JGLOBAL_DESCRIPTION"
                    description="JGLOBAL_SUBHEADING_DESC"
                    default="This is my slogan"
                    filter="string" />
                <field
                    name="copyright-from"
                    type="number"
                    default="2005"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COPYRIGHT_FROM"
                    description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COPYRIGHT_FROM"
                    step="1"
                    required="true" />
            </fieldset>
            <fieldset name="cookieconsent">
                <field
                    type="spacer"
                    name="cookieconsent_separator_general"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_SEPARATOR_general" />
                <field
                    name="cookieconsent_activate"
                    type="checkbox"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_ACTIVATE"
                    description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_ACTIVATE"
                    checked="1"
                    value="1" />
                <field
                        name="cookieconsent_position"
                        type="list"
                        default="top"
                        required="true"
                        label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_POSITION"
                        description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_POSITION">
                          <option value="top">TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_POSITION_BANNER_TOP</option>
                            <option value="top-pushdown">TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_POSITION_BANNER_TOP_PUSHDOWN</option>
                            <option value="bottom">TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_POSITION_BANNER_BOTTOM</option>
                          <option value="bottom-left">TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_POSITION_FLOATING_LEFT</option>
                            <option value="bottom-right">TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_POSITION_FLOATING_RIGHT</option>
                    </field>

                <field
                    type="spacer"
                    name="cookieconsent_separator_colors"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_SEPARATOR_COLORS" />
                <field
                        name="cookieconsent_color_banner"
                        required="true"
                        type="color"
                        default="#efefef"
                        label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_COLOR_BANNER"
                        description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_COLOR_BANNER" />
                <field
                        name="cookieconsent_color_button"
                        required="true"
                        type="color"
                        default="#8ec760"
                        label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_COLOR_BUTTON"
                        description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_COLOR_BUTTON" />
                <field
                        name="cookieconsent_color_banner_text"
                        required="true"
                        type="color"
                        default="#404040"
                        label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_COLOR_BANNER_TEXT"
                        description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_COLOR_BANNER_TEXT" />
                <field
                        name="cookieconsent_color_button_text"
                        required="true"
                        type="color"
                        default="#ffffff"
                        label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_COLOR_BUTTON_TEXT"
                        description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_COLOR_BUTTON_TEXT" />

                <field
                    type="spacer"
                    name="cookieconsent_separator_texts"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_SEPARATOR_TEXTS" />
                <field
                    name="cookieconsent_learnmore_text"
                    type="text"
                    default="Mehr erfahren"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_LEARNMORE_TEXT"
                    description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_LEARNMORE_TEXT"
                    filter="string" />
                <field
                    name="cookieconsent_learnmore_link"
                    type="url"
                    default="impressum-datenschutz"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_LEARNMORE_LINK"
                    description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_LEARNMORE_LINK" />
             <field
                    name="cookieconsent_message"
                    type="textarea"
                    default="Um die Funktionalität und den Inhalt der Website zu optimieren, verwenden wir Cookies. Durch die Nutzung unserer Website stimmst du der Verwendung von Cookies zu."
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_MESSAGE"
                    description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_MESSAGE"
                    rows="10"
                    cols="5" />
                <field
                    name="cookieconsent_dismiss_button"
                    type="text"
                    default="Verstanden"
                    label="TPL_SVFOOBAR_FIELDS_LABEL_COOKIECONSENT_DISMISS_BUTTON"
                    description="TPL_SVFOOBAR_FIELDS_DESCRIPTION_COOKIECONSENT_DISMISS_BUTTON" />
            </fieldset>
        </fields>
    </config>
</extension>

尝试更新扩展标签以包含升级方法:

<extension version="3.8" type="template" method="upgrade" client="site">