<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pixelstunde</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pixelstunde"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Pixelstunde"/>
	<updated>2026-07-08T10:09:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x_talk:Creating_a_simple_module/Developing_a_Basic_Module/de&amp;diff=594703</id>
		<title>J3.x talk:Creating a simple module/Developing a Basic Module/de</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x_talk:Creating_a_simple_module/Developing_a_Basic_Module/de&amp;diff=594703"/>
		<updated>2019-02-24T10:02:45Z</updated>

		<summary type="html">&lt;p&gt;Pixelstunde: Created page with &amp;quot;Ist nicht die Benutzung von &amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt; JLoader::register(&amp;#039;ModHelloWorldHelper&amp;#039;, __DIR__ . &amp;#039;/helper.php&amp;#039;); &amp;lt;/source&amp;gt; der bessere Weg um den Helper zu laden?&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ist nicht die Benutzung von&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
JLoader::register(&#039;ModHelloWorldHelper&#039;, __DIR__ . &#039;/helper.php&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
der bessere Weg um den Helper zu laden?&lt;/div&gt;</summary>
		<author><name>Pixelstunde</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Adding_JavaScript_and_CSS_to_the_page&amp;diff=387330</id>
		<title>J3.x:Adding JavaScript and CSS to the page</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Adding_JavaScript_and_CSS_to_the_page&amp;diff=387330"/>
		<updated>2017-03-27T05:24:49Z</updated>

		<summary type="html">&lt;p&gt;Pixelstunde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Inserting from a File == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
To have a well-formed HTML document, you must put all references to Javascript and CSS files within the &amp;lt;code&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/code&amp;gt; portion. Since Joomla! generates all the HTML that makes up a page before output, it is possible to add these references within the &amp;lt;tt&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/tt&amp;gt; tags from your extension. The simplest way to do this is to make use of the functionality built in to Joomla.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
===JDocument=== &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
First, get a reference to the current document object:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
Then for a stylesheet, use this code:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document-&amp;gt;addStyleSheet($url);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
To add a Javascript file, use this code:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document-&amp;gt;addScript($url);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
where &amp;lt;code&amp;gt;$url&amp;lt;/code&amp;gt; is the variable containing the full path to the javascript or CSS file for example:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;JUri::base() . &#039;templates/custom/js/sample.js&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
Note this will **NOT** include Mootools or jQuery. If your script requires Mootools or jQuery see [[S:MyLanguage/Javascript_Frameworks|Javascript Frameworks]] for full details on how to include them (note jQuery can only be included natively on Joomla! 3.0+).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
It used to be possible to do this with JHTML, however, this was deprecated in Joomla 2.5 and removed in Joomla 3.x.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding the options to your JavaScript code == &amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{Joomla version|version=3.7|time=and after|comment=&amp;lt;translate&amp;gt;&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
Only available in Joomla! 3.7 and higher&amp;lt;/translate&amp;gt;|align=left}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
Beside adding inline scripts, Joomla! provide mechanism to store the options in the &amp;quot;optionsStorage&amp;quot;.&lt;br /&gt;
This is allowed to nicely manage an existing options on the server side and on the client side. And allow to place all JavaScript logic to the JavaScript file, that will be cached by browser.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Joomla! use special mechanism for &amp;quot;lazy loading&amp;quot; the options on the client side. It do not use inline JavaScript, that is good for page rendering speed, and make your site more friendly for the Speed Tester (eg Google).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Thus use &amp;quot;optionsStorage&amp;quot; preferred, than use inline JavaScript to add the script options.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example of use&#039;&#039;&#039;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Add the script options to your module:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addScriptOptions(&#039;mod_example&#039;,&lt;br /&gt;
    &#039;colors&#039; =&amp;gt; array(&#039;selector&#039; =&amp;gt; &#039;body&#039;, &#039;color&#039; =&amp;gt; &#039;orange&#039;),&lt;br /&gt;
    &#039;sliderOptions&#039; =&amp;gt; array(&#039;selector&#039; =&amp;gt; &#039;.my-slider&#039;, &#039;timeout&#039; =&amp;gt; 300, &#039;fx&#039; =&amp;gt; &#039;fade&#039;),&lt;br /&gt;
));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Access to your options on the client side:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var myOptions = Joomla.getOptions(&#039;mod_example&#039;);&lt;br /&gt;
console.log(myOptions.colors); // Print in the browser console your options&lt;br /&gt;
console.log(myOptions.sliderOptions);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Override the options on server side (possible until the head rendering):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document  = JFactory::getDocument();&lt;br /&gt;
// Get existing options&lt;br /&gt;
$myOptions = $document-&amp;gt;getScriptOptions(&#039;mod_example&#039;);&lt;br /&gt;
// Change the value&lt;br /&gt;
$myOptions[&#039;colors&#039;] = array(&#039;selector&#039; =&amp;gt; &#039;body&#039;, &#039;color&#039; =&amp;gt; &#039;green&#039;);&lt;br /&gt;
// Set new options&lt;br /&gt;
$document-&amp;gt;addScriptOptions(&#039;mod_example&#039;, $myOptions);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Inserting inline scripts from within a PHP file == &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
If your Javascript or CSS are generated using PHP, you can add the script or stylesheet directly into the head of your document:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
&lt;br /&gt;
// Add Javascript&lt;br /&gt;
$document-&amp;gt;addScriptDeclaration(&#039;&lt;br /&gt;
    window.event(&amp;quot;domready&amp;quot;, function() {&lt;br /&gt;
        alert(&amp;quot;An inline JavaScript Declaration&amp;quot;);&lt;br /&gt;
    });&lt;br /&gt;
&#039;);&lt;br /&gt;
&lt;br /&gt;
// Add styles&lt;br /&gt;
$style = &#039;body {&#039;&lt;br /&gt;
        . &#039;background: #00ff00;&#039;&lt;br /&gt;
        . &#039;color: rgb(0,0,255);&#039;&lt;br /&gt;
        . &#039;}&#039;; &lt;br /&gt;
$document-&amp;gt;addStyleDeclaration($style);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== Javascript Example === &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
For example, the following code is used to define a custom tool tip that takes advantage of mootools.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function getToolTipJS($toolTipVarName, $toolTipClassName){&lt;br /&gt;
    $javascript = &#039;window.addEvent(\&amp;quot;domready\&amp;quot;, function(){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t&amp;quot;  .&#039;var $toolTipVarName = new Tips($$(&amp;quot;&#039; . $toolTipVarName .&#039;&amp;quot;), {&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;className: &amp;quot;&#039; .$toolTipClassName .&#039;&amp;quot;,&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;initialize: function(){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx = new Fx.Style(this.toolTip, &amp;quot;opacity&amp;quot;, {duration: 500, wait: false}).set(0);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;},&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;onShow: function(toolTip){&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx.start(1);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;},&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;onHide: function(toolTip) {&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t\t&amp;quot;    .&#039;this.fx.start(0);&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t\t&amp;quot;   .&#039;}&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &amp;quot;\t&amp;quot;  .&#039;});&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
    $javascript .= &#039;});&#039; .&amp;quot;\n\n&amp;quot;;&lt;br /&gt;
    return $javascript;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleSheet(&amp;quot;/joomla/components/com_mycustomcomponent/css/mytooltip.css&amp;quot;,&#039;text/css&#039;,&amp;quot;screen&amp;quot;);&lt;br /&gt;
$document-&amp;gt;addScriptDeclaration(getToolTipJS(&amp;quot;mytool&amp;quot;,&amp;quot;MyToolTip&amp;quot;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Note that in order for this Javascript to be functionally useful, it would be necessary to include the appropriate class name in the HTML, as well as providing the &amp;lt;code&amp;gt;mytooltip.css&amp;lt;/code&amp;gt; file. Both are outside the scope of this article.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
=== CSS Examples === &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
This is also useful if your inserting a form field of CSS into your code. For example in a module, you might want a user to choose to call the colour of the border. After calling the form fields value and assigning it a variable $bordercolor in mod_example.php. Then in tmpl/default.php you can include the following:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addStyleSheet(&#039;mod_example/mod_example.css&#039;);&lt;br /&gt;
$style = &#039;#example {&lt;br /&gt;
	border-color:#&#039; . $bordercolor . &#039;;&lt;br /&gt;
	}&#039;;&lt;br /&gt;
$document-&amp;gt;addStyleDeclaration( $style );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Here mod_example.css contains the CSS file of any non-parameter based styles. Then the bordercolor parameter/form field is added in separately.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Add Custom Tag== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
There will be some occasions where even these functions are not flexible enough, as they are limited to writing the contents of &amp;lt;code&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;style /&amp;gt;&amp;lt;/code&amp;gt; tags, and cannot add anything outside those tags. One example would be the inclusion of a stylesheet link within conditional comments, so that it is picked up only by Internet Explorer 6 and earlier. To do this, use &amp;lt;code&amp;gt;$document-&amp;gt;addCustomTag&amp;lt;/code&amp;gt;:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$stylelink = &#039;&amp;lt;!--[if lte IE 6]&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
$stylelink .= &#039;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;../css/IEonly.css&amp;quot; /&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
$stylelink .= &#039;&amp;lt;![endif]--&amp;gt;&#039; .&amp;quot;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$document-&amp;gt;addCustomTag($stylelink);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Component Development]]&lt;br /&gt;
[[Category:Module Development]]&lt;br /&gt;
[[Category:JavaScript]]&lt;br /&gt;
[[Category:CSS]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pixelstunde</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387140</id>
		<title>Adding stylesheets for other output devices</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387140"/>
		<updated>2017-03-26T20:46:17Z</updated>

		<summary type="html">&lt;p&gt;Pixelstunde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Using CSS style sheets, it is possible to use a set of directives(styles) depending upon the device being used to browse web pages.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Media Types=== &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
The recognised media types are:&lt;br /&gt;
*all - Suitable for all devices. &lt;br /&gt;
*aural - For speech synthesizers. &lt;br /&gt;
*braille - Intended for braille tactile feedback devices.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
*embossed - Intended for paged braille printers. &lt;br /&gt;
*handheld - Intended for handheld devices. &lt;br /&gt;
*print - Used for formatting printed pages. &lt;br /&gt;
*projection - Intended for projected presentations, for example projectors or print to transparencies.&lt;br /&gt;
*screen - Intended primarily for color computer screens.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
*tty - Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. Authors should not use pixel units with the &amp;quot;tty&amp;quot; media type. &lt;br /&gt;
*tv - Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Examples=== &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
You can assign a media type to a CSS declaration with the following syntax&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print {&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000; &lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
To assign more than one declaration style to more than one media type:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print, handheld{&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000;&lt;br /&gt;
  }&lt;br /&gt;
  img {&lt;br /&gt;
    max-width: 100%;&lt;br /&gt;
    height: auto;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The directives can be used in the main CSS file or in a separate style sheet for a given media type. There must be an include to the CSS file in the templates &amp;lt;head&amp;gt; section (the following is taken from the Joomla! Beez template):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;baseurl ?&amp;gt;/templates/beez/css/print.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;Print&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The recommended way to include a stylesheet is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
 $tpath = $this-&amp;gt;baseurl . &#039;/templates/&#039; . $this-&amp;gt;template;&lt;br /&gt;
$document-&amp;gt;addStyleSheet( $tpath . &#039;/css/print.css&#039;, &#039;text/css&#039;, &#039;print&#039;); // arguments: $path, $type, $media&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way, you ensure the stylesheet will be added to the document and is accessible to plugins (e.g for combining and compressing stylesheets).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:CSS]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pixelstunde</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387137</id>
		<title>Adding stylesheets for other output devices</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387137"/>
		<updated>2017-03-26T20:30:33Z</updated>

		<summary type="html">&lt;p&gt;Pixelstunde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Using CSS style sheets, it is possible to use a set of directives(styles) depending upon the device being used to browse web pages.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Media Types=== &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
The recognised media types are:&lt;br /&gt;
*all - Suitable for all devices. &lt;br /&gt;
*aural - For speech synthesizers. &lt;br /&gt;
*braille - Intended for braille tactile feedback devices.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
*embossed - Intended for paged braille printers. &lt;br /&gt;
*handheld - Intended for handheld devices. &lt;br /&gt;
*print - Used for formatting printed pages. &lt;br /&gt;
*projection - Intended for projected presentations, for example projectors or print to transparencies.&lt;br /&gt;
*screen - Intended primarily for color computer screens.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
*tty - Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. Authors should not use pixel units with the &amp;quot;tty&amp;quot; media type. &lt;br /&gt;
*tv - Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Examples=== &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
You can assign a media type to a CSS declaration with the following syntax&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print {&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000; &lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
To assign more than one declaration style to more than one media type:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print, handheld{&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000;&lt;br /&gt;
  }&lt;br /&gt;
  img {&lt;br /&gt;
    max-width: 100%;&lt;br /&gt;
    height: auto;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The directives can be used in the main CSS file or in a separate style sheet for a given media type. There must be an include to the CSS file in the templates &amp;lt;head&amp;gt; section (the following is taken from the Joomla! Beez template):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;baseurl ?&amp;gt;/templates/beez/css/print.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;Print&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The recommended way to include a stylesheet is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$app = JFactory::getApplication();&lt;br /&gt;
$tpath = JURI::base(true) . &#039;/templates/&#039; . $app-&amp;gt;getTemplate() . &#039;/&#039;;&lt;br /&gt;
$document-&amp;gt;addStyleSheet( $tpath . &#039;css/print.css&#039;, &#039;text/css&#039;, &#039;print&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way, you ensure the stylesheet will be added to the document and is accessible to plugins (e.g for combining and compressing stylesheets).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:CSS]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pixelstunde</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387135</id>
		<title>Adding stylesheets for other output devices</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387135"/>
		<updated>2017-03-26T20:27:50Z</updated>

		<summary type="html">&lt;p&gt;Pixelstunde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Using CSS style sheets, it is possible to use a set of directives(styles) depending upon the device being used to browse web pages.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Media Types=== &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
The recognised media types are:&lt;br /&gt;
*all - Suitable for all devices. &lt;br /&gt;
*aural - For speech synthesizers. &lt;br /&gt;
*braille - Intended for braille tactile feedback devices.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
*embossed - Intended for paged braille printers. &lt;br /&gt;
*handheld - Intended for handheld devices. &lt;br /&gt;
*print - Used for formatting printed pages. &lt;br /&gt;
*projection - Intended for projected presentations, for example projectors or print to transparencies.&lt;br /&gt;
*screen - Intended primarily for color computer screens.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
*tty - Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. Authors should not use pixel units with the &amp;quot;tty&amp;quot; media type. &lt;br /&gt;
*tv - Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Examples=== &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
You can assign a media type to a CSS declaration with the following syntax&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print {&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000; &lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
To assign more than one declaration style to more than one media type:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print, handheld{&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000;&lt;br /&gt;
  }&lt;br /&gt;
  img {&lt;br /&gt;
    max-width: 100%;&lt;br /&gt;
    height: auto;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The directives can be used in the main CSS file or in a separate style sheet for a given media type. There must be an include to the CSS file in the templates &amp;lt;head&amp;gt; section (the following is taken from the Joomla! Beez template):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;baseurl ?&amp;gt;/templates/beez/css/print.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;Print&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The recommended way to include a stylesheet is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$app = JFactory::getApplication();&lt;br /&gt;
$tpath = JURI::base(true) . &#039;/templates/&#039; . $app-&amp;gt;getTemplate() . &#039;/&#039;;&lt;br /&gt;
$document-&amp;gt;addStyleSheet( $tpath . &#039;css/print.css&#039;, &#039;text/css&#039;, &#039;print&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:CSS]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pixelstunde</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387134</id>
		<title>Adding stylesheets for other output devices</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Adding_stylesheets_for_other_output_devices&amp;diff=387134"/>
		<updated>2017-03-26T20:26:21Z</updated>

		<summary type="html">&lt;p&gt;Pixelstunde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&amp;lt;languages /&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Using CSS style sheets, it is possible to use a set of directives(styles) depending upon the device being used to browse web pages.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Media Types=== &amp;lt;!--T:2--&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
The recognised media types are:&lt;br /&gt;
*all - Suitable for all devices. &lt;br /&gt;
*aural - For speech synthesizers. &lt;br /&gt;
*braille - Intended for braille tactile feedback devices.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
*embossed - Intended for paged braille printers. &lt;br /&gt;
*handheld - Intended for handheld devices. &lt;br /&gt;
*print - Used for formatting printed pages. &lt;br /&gt;
*projection - Intended for projected presentations, for example projectors or print to transparencies.&lt;br /&gt;
*screen - Intended primarily for color computer screens.&amp;lt;/translate&amp;gt; &lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
*tty - Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. Authors should not use pixel units with the &amp;quot;tty&amp;quot; media type. &lt;br /&gt;
*tv - Intended for television-type devices (low resolution, color, limited-scrollability screens, sound available).&amp;lt;/translate&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;===Examples=== &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
You can assign a media type to a CSS declaration with the following syntax&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print {&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000; &lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
To assign more than one declaration style to more than one media type:&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
@media print, handheld{&lt;br /&gt;
  body { &lt;br /&gt;
    font-size: 12pt;&lt;br /&gt;
    font-color: #000000;&lt;br /&gt;
  }&lt;br /&gt;
  img {&lt;br /&gt;
    max-width: 100%;&lt;br /&gt;
    height: auto;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The directives can be used in the main CSS file or in a separate style sheet for a given media type. There must be an include to the CSS file in the templates &amp;lt;head&amp;gt; section (the following is taken from the Joomla! Beez template):&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;&amp;lt;?php echo $this-&amp;gt;baseurl ?&amp;gt;/templates/beez/css/print.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;Print&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The recommended way to include a stylesheet is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$document = JFactory::getDocument();&lt;br /&gt;
$tpath = JURI::base(true) . &#039;/templates/&#039; . $app-&amp;gt;getTemplate() . &#039;/&#039;;&lt;br /&gt;
$document-&amp;gt;addStyleSheet( $tpath . &#039;css/print.css&#039;, &#039;text/css&#039;, &#039;print&#039;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
[[Category:CSS]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pixelstunde</name></author>
	</entry>
</feed>