Jetzt funktioniert es danke für die Mühe!
Beiträge von ruhrpottbobo im Thema „If und Template“
-
-
Hab das so gemacht und jetzt kann ich es nicht mal mehr installieren.
XML
Alles anzeigen<?xml version="1.0" encoding="UTF-8"?> <data 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/templatelistener.xsd"> <import> <!-- user --> <templatelistener name="CopyrightListener"> <environment>user</environment> <templatename>footer</templatename> <eventname>copyright</eventname> <templatecode>{if $templateName == "dKMCustom"}<address class="copyright marginTop"><a href="https://www.dokreativmedia.com/" {if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}com.dokreativmedia.custompage.copyright{/lang}</a></address>{/if}</templatecode> </templatelistener> <!-- /user --> </import> </data>
kommt dieser Fehler, sry wegen der Mühe
Code
Alles anzeigenFatal error: XML document 'D:\xampp\htdocs\forum\wcf/tmp/xml_7472299fe67e0afacd68515035f624b674aaaf46' is not valid XML. LibXML output: #9 error parsing attribute name #9 attributes construct error #9 Couldn't find end of Start Tag a line 9 #9 Opening and ending tag mismatch: address line 9 and a #9 Opening and ending tag mismatch: templatecode line 9 and address #9 Opening and ending tag mismatch: templatelistener line 5 and templatecode #10 Opening and ending tag mismatch: import line 3 and templatelistener #12 Opening and ending tag mismatch: data line 2 and import #13 Extra content at the end of the document Information: id: 7ff3b9f248d2c538b779c962c466b94e1b0d53f7 error message: XML document 'D:\xampp\htdocs\forum\wcf/tmp/xml_7472299fe67e0afacd68515035f624b674aaaf46' is not valid XML. error code: 0 file: D:\xampp\htdocs\forum\wcf\lib\util\XML.class.php (184) php version: 5.6.12 wcf version: 2.1.10 (Typhoon) date: Mon, 30 May 2016 11:16:50 +0000 request: /forum/acp/index.php?install-package/&& referer: http://localhost/forum/acp/index.php?package-installation-confirm/&queueID=1474& Stacktrace: #0 D:\xampp\htdocs\forum\wcf\lib\util\XML.class.php(68): wcf\util\XML->throwException('XML document 'D...', Array) #1 D:\xampp\htdocs\forum\wcf\lib\system\package\plugin\AbstractXMLPackageInstallationPlugin.class.php(300): wcf\util\XML->load('D:\\xampp\\htdocs...') #2 D:\xampp\htdocs\forum\wcf\lib\system\package\plugin\AbstractXMLPackageInstallationPlugin.class.php(58): wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin->getXML('templateListene...') #3 D:\xampp\htdocs\forum\wcf\lib\system\package\PackageInstallationDispatcher.class.php(571): wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin->install() #4 D:\xampp\htdocs\forum\wcf\lib\system\package\PackageInstallationDispatcher.class.php(139): wcf\system\package\PackageInstallationDispatcher->executePIP(Array) #5 D:\xampp\htdocs\forum\wcf\lib\acp\action\InstallPackageAction.class.php(73): wcf\system\package\PackageInstallationDispatcher->install('6f9146b2') #6 D:\xampp\htdocs\forum\wcf\lib\action\AbstractDialogAction.class.php(70): wcf\acp\action\InstallPackageAction->stepInstall() #7 D:\xampp\htdocs\forum\wcf\lib\action\AbstractAction.class.php(49): wcf\action\AbstractDialogAction->execute() #8 D:\xampp\htdocs\forum\wcf\lib\system\request\Request.class.php(58): wcf\action\AbstractAction->__run() #9 D:\xampp\htdocs\forum\wcf\lib\system\request\RequestHandler.class.php(139): wcf\system\request\Request->execute() #10 D:\xampp\htdocs\forum\acp\index.php(10): wcf\system\request\RequestHandler->handle('wbb', true) #11 {main}
IM Quellcode wird der Link garnicht angezeigt.
-
Ist ja witzig mit kleinem d funktioniert es, aber der Link wird nicht angezeigt.
XML
Alles anzeigen<?xml version="1.0" encoding="UTF-8"?> <data 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/templatelistener.xsd"> <import> <!-- user --> <templatelistener name="CopyrightListener"> <environment>user</environment> <templatename>footer</templatename> <eventname>copyright</eventname> <templatecode>{if $templateName == "dKMCustom"}<address class="copyright marginTop"><a href="https://www.dokreativmedia.com/">{lang}com.dokreativmedia.custompage.copyright{/lang}</a></address>{/if}</templatecode> </templatelistener> <!-- /user --> </import> </data>
-
Es wird nichts angezeigt und eben die Linkanweisung wird nicht als Link angezeigt
-
Hmm zeigt nix an, das Template heisst DKMcustom, ohne die If Anweisung wird es überall angezeigt, aber der Link funktioniert nicht
XML
Alles anzeigen<?xml version="1.0" encoding="UTF-8"?> <data 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/templatelistener.xsd"> <import> <!-- user --> <templatelistener name="CopyrightListener"> <environment>user</environment> <templatename>footer</templatename> <eventname>copyright</eventname> <templatecode>{if $templateName == "DKMcustom"}<address class="copyright"><a href="https://www.dokreativmedia.com/" target="_blank">{lang}com.dokreativmedia.custompage.copyright{/lang}</a></address>{/if}</templatecode> </templatelistener> <!-- /user --> </import> </data>
-
Kann ich folgende If Abfrage machen. Ich möchte gern das die Bedingung nur dann ausgeführt wird, wenn genau dieses Template angezeigt wid.
Hintegrund, ich fummle ja an einer Custom Page, das ist ja keine Applikation. Ich möchte gern das wenn man diese Seite aufgerufen hat dann auch das copyright angezeigt wird unten. Ich habe das über den Templatelistener gemacht. Ich möchte aber nicht das es überall angezeigt wird, sondern nur unter dieser einen Seite.