<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://de.contaowiki.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
		<id>https://de.contaowiki.org/index.php?action=history&amp;feed=atom&amp;title=Device-Detection</id>
		<title>Device-Detection - Versionsgeschichte</title>
		<link rel="self" type="application/atom+xml" href="https://de.contaowiki.org/index.php?action=history&amp;feed=atom&amp;title=Device-Detection"/>
		<link rel="alternate" type="text/html" href="https://de.contaowiki.org/index.php?title=Device-Detection&amp;action=history"/>
		<updated>2026-05-02T13:26:35Z</updated>
		<subtitle>Versionsgeschichte dieser Seite in Contao Community Documentation</subtitle>
		<generator>MediaWiki 1.22.6</generator>

	<entry>
		<id>https://de.contaowiki.org/index.php?title=Device-Detection&amp;diff=8504&amp;oldid=prev</id>
		<title>Ainschy: /* Module Template auswählen */</title>
		<link rel="alternate" type="text/html" href="https://de.contaowiki.org/index.php?title=Device-Detection&amp;diff=8504&amp;oldid=prev"/>
				<updated>2015-04-01T15:07:09Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Module Template auswählen&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 1. April 2015, 15:07 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ich hoffe die Anleitung ist für euch hilfreich.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ich hoffe die Anleitung ist für euch hilfreich.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Viele Grüße &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Ainschy aka &lt;/del&gt;Oliver Willmes&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Viele Grüße Oliver Willmes &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;aka [[Benutzer:Ainschy|Ainschy]] ([[Benutzer Diskussion:Ainschy|Diskussion]]) 17:07, 1. Apr. 2015 (CEST)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key kunde29sql1:diff:version:1.11a:oldid:8503:newid:8504 --&gt;
&lt;/table&gt;</summary>
		<author><name>Ainschy</name></author>	</entry>

	<entry>
		<id>https://de.contaowiki.org/index.php?title=Device-Detection&amp;diff=8503&amp;oldid=prev</id>
		<title>Ainschy: Die Seite wurde neu angelegt: „'''Ausgaben von Modulen/Inhaltselementen anhand der Erweiterung: mobiledetection steuern''' == mobiledetection installieren ==  Bugbuster aka Glen Langer hat a…“</title>
		<link rel="alternate" type="text/html" href="https://de.contaowiki.org/index.php?title=Device-Detection&amp;diff=8503&amp;oldid=prev"/>
				<updated>2015-04-01T15:05:05Z</updated>
		
		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „&amp;#039;&amp;#039;&amp;#039;Ausgaben von Modulen/Inhaltselementen anhand der Erweiterung: mobiledetection steuern&amp;#039;&amp;#039;&amp;#039; == mobiledetection installieren ==  Bugbuster aka Glen Langer hat a…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Ausgaben von Modulen/Inhaltselementen anhand der Erweiterung: mobiledetection steuern'''&lt;br /&gt;
== mobiledetection installieren ==&lt;br /&gt;
&lt;br /&gt;
Bugbuster aka Glen Langer hat auf GitHub die Erweiterung [https://github.com/BugBuster1701/mobiledetection mobiledetection] für Contao entwickelt.&lt;br /&gt;
Hiermit werden dem &amp;lt;body&amp;gt; Tag die Klassen phone, tablet oder computer hinzugefügt, per CSS kann anschließend darauf reagieren.&lt;br /&gt;
&lt;br /&gt;
Möchte man jedoch einzelne Elemente oder Module auf einem Smartphone erst gar nicht laden, oder wie im meinem Fall nur auf dem Computer ausgeben, Stichwort Hintergrund-Video so brauchen wir eine Anpassung auf Template Ebene.&lt;br /&gt;
&lt;br /&gt;
Die oben genannte Erweiterung von BugBuster bietet hierzu zwei Funktionen an.&lt;br /&gt;
&lt;br /&gt;
== Das Template mod_html anpassen ==&lt;br /&gt;
In unserem Beispiel wird die mod_html angepasst und für die spätere Anwendung unter einem anderen Namen gespeichert. Legt im Backend unter Layout-&amp;gt;Templates ein Kopie des ''mod_html.html5'' Templates an. Benennt diese z.B. in ''mod_html_computer_only'' um, und ändert den Programmcode wie folgt.&lt;br /&gt;
&amp;lt;source&amp;gt;&amp;lt;?php&lt;br /&gt;
use Detection\MobileDetect;&lt;br /&gt;
$detect = new MobileDetect();&lt;br /&gt;
if (!$detect-&amp;gt;isMobile() &amp;amp;&amp;amp; !$detect-&amp;gt;isTablet()) : &lt;br /&gt;
	echo $this-&amp;gt;html;&lt;br /&gt;
endif;&lt;br /&gt;
?&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
Als erstes wird das Module aufgerufen und eine neue Instanz erzeugt. Anschließend wird über eine Abfrage geprüft ob das Endgerät der Kategorie Mobile oder Tablet gehört, trifft dies beides nicht zu, muss es ein computer sein und die Ausgabe erfolgt.&lt;br /&gt;
&lt;br /&gt;
== Module Template auswählen ==&lt;br /&gt;
Legt ein neues Module vom Typ HTML an und wählt als Individuelles Template unser zuvor angelegtes mod_html_computer_only aus. Der Inhalt des HTML Modules wird nun nur noch auf den computer Device ausgegeben.&lt;br /&gt;
Die Angabe eines Individuellen Templates wurde in Contao 3.3 eingeführt und steht der Module-Konfiguration und den Inhaltselementen zur Verfügung. Zuvor war dieses nur über eine Erweiterung [https://contao.org/en/extension-list/view/template_override.10010049.en.html template_override] ab Contao 2.11 möglich.&lt;br /&gt;
&lt;br /&gt;
Ich hoffe die Anleitung ist für euch hilfreich.&lt;br /&gt;
Viele Grüße Ainschy aka Oliver Willmes&lt;/div&gt;</summary>
		<author><name>Ainschy</name></author>	</entry>

	</feed>