​How do I add a language variable to a template?

  • How do I add a language variable to a template? I just want to add three words below the WoltLab copyright in the footer template.

  • Thanks for the reply @MysteryCode. I'm trying to add a simple link back to my forum in a style that I want to submit to the Plugin-Store. I can't just add plain text to the template because it's not allowed for some reason, and I have no idea how to do it any other way. Unfortunately none of the things you mentioned are an option.

  • Ahh okay. That's a different situation then.
    The following is a part of my commercial plugins:


    XML: package.xml
    <instructions type="install">
    		<instruction type="templateListener">xml/templateListener.xml</instruction>
    		<instruction type="language">language/*.xml</instruction>
    	</instructions>


    XML: languages/en.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <language xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/language.xsd" languagecode="en">
    	<category name="mcps.index">
    		<item name="mcps.index.copyright"><![CDATA[<a href="http://www.mysterycode.de/"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>Software: <strong>Package-Server</strong>, developed by <strong>MysteryCode</strong></a>]]></item>
    	</category>
    </language>

    mcps.index.copyright has to be replaces with your own language item and you should rename it for a unique identifier-string.
    I don't know how good your coding skills are, but I need to sleep a bit. I got an important date in 5 hours, but if you have questions regarding the code, just ask. ;)

  • I don't know how good your coding skills are

    I'm afraid they are not very good. I am assuming that I need to create a package.xml file with the code above, a folder named xml with a file in it named templateListener.xml with the code shown, and a languages folder with a en.xml file in it (with modified code). The package.xml file, the xml folder and the languages folder would then go in my package file along with the style? I have tried doing that and got the following error: Fatal error: Call to a member function getAttribute() on null in /home/xxxxxxxxx/public_html/wcf/lib/system/package/PackageArchive.class.php on line 170.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!