RSS

Category Archives: joomla

How do you put a module inside an article?

http://docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F

{loadposition user1}
Advertisements
 
Leave a comment

Posted by on January 16, 2013 in joomla

 

Joomla – Template: Place Text (Part 8)

Joomla Template Tutorial – Part 8: Texts is an element in web. In this posting, we will learn how to place text in our template. We use JText to replace direct text.

This is example using text in joomla template:

<?php echo JText::_('Powered by') ?> 
<a href="http://www.joomla.org">Joomla!</a>.
<?php echo JText::_('Valid') ?> 
<a href="http://validator.w3.org/check/referer">XHTML</a>
<?php echo JText::_('and') ?>
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.

Put it on your layout within index.php. Example result like this:

 
Leave a comment

Posted by on December 3, 2012 in joomla

 

Joomla – Template: Using Parameters (Part 7)

Joomla Template Tutorial – Part 7: For more flexible design, we can use parameters in our template. So, you can provide options to change template without your users touch line codes. For example, your user can choose background color.

In this post, we try to provide background color option. Following this steps:

  1. Open templateDetails.xml within your Joomla\templates\mytemplate.
  2. Enter following bold code:
<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" type="template">
<name>mytemplate</name>
<version>1.0.0</version>
<creationDate>12/12/07</creationDate>
<author>Wiwit Siswoutomo</author>
<authorEmail>wsiswoutomo@yahoo.com</authorEmail>
<authorUrl>http://www.phpeveryday.com</authorUrl>
<copyright></copyright>
<license>GNU/GPL</license>
<description>TPL_MY_TEMPLATE</description>
<files>
  <filename>index.php</filename>
  <filename>templateDetails.xml</filename>
</files>
<positions>
  <position>breadcrumbs</position>
  <position>left</position>
  <position>right</position>
  <position>top</position>
  <position>user1</position>
  <position>user2</position>
  <position>user3</position>
  <position>user4</position>
  <position>footer</position>
  <position>debug</position>
  <position>syndicate</position>
</positions>
<params>
  <param name="backgroundVariation" 
type="list" default="blue" label="Background Variation" 
description="Background color variation to use">
    <option value="blue">Blue</option>
    <option value="red">Red</option>
    <option value="green">Green</option>
    <option value="orange">Orange</option>
    <option value="black">Black</option>
    <option value="white">White</option>
    <option value="yellow">Yellow</option>
  </param>
</params>
</install>
  1. Next, create a file named “params.ini” within Joomla\templates\mytemplate. This file contents choosed value for parameters. Enter following code:(backgroundVariation=blue)
  2. Open your index.php within Joomla\templates\mytemplate. Change tag <body> become:
<body bgcolor="<?php echo $this->params->get('backgroundVariation'); ?>">

<li>Now try to point your browser to http://localhost/joomla. You can see like following screen:<br>
<img src="http://farm3.static.flickr.com/2271/2126057153_32281c0206.jpg?v=0">

</li><li>Now, try to open your joomla administration. Open at <b>Extensions > Template Manager</b>.

</li><li>Click at link mytemplate:<br>
<img src="http://farm3.static.flickr.com/2233/2126833476_15db1d1e13.jpg?v=0">

</li><li>You will get template edit page. Now, focus your attention at Parameters box. Change Background Variation become Red.<br>
<img src="http://farm3.static.flickr.com/2101/2126833946_1a18482349.jpg?v=0">

</li><li>Click Save button on the top.<br>
<img src="http://farm3.static.flickr.com/2342/2126058289_2d04609fc3.jpg?v=0">

</li>

Point your browser to http://localhost/joomla. Background color has changed
2126835000_5977ef90c6=d

 


 

 
Leave a comment

Posted by on December 3, 2012 in joomla

 

Joomla – Template: Using jdoc (part 6)

Joomla Template Tutorial – Part 6: In Joomla Template, the important thing is jdoc tag. As you see at below picture, jdoc tag is a way load module, component, and head component (like title, description, keywords, etc). In this post, we will try to use jdoc tag.

I just rememberring picture that placed jdoc in blocks.

2126055827_ff2f20216b=b

From the picture, you can guess the jdoc formula:

<jdoc:include type=”[head|module|component]” />

So, open your index.php within mytemplate folder. Add following bold code:

<?
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<html>
<head>
<jdoc:include type="head" />
</head>

<body>

<table width="100%" border="1" bgcolor="#FFFF00">
    <tr>
      	<td 
colspan="3">
<jdoc:include type="modules" name="top" /></td>    
    </tr>
    <tr>
      	<td colspan="2">jdoc:include type="modules" 
name="user3" /></td>    
      	<td>jdoc:include 
type="modules" name="user4" /></td>        
    </tr>
    <tr>
      	<td rowspan="2" 
valign="top">jdoc:include 
type="modules" name="left" /></td>
      	<td colspan="2">
        	<table width="100%" border="1">
            	<tr>
                	<td>jdoc:include type="modules" 
name="user1" /></td>
                	<td>jdoc:include type="modules" 
name="user2" /></td>                
                </tr>
            </table>
        </td> 
    </tr>
    <tr>  
      	<td height="200">jdoc:include 
type="component" /></td>
      	<td valign="top">jdoc:include type="modules" 
name="right" /></td>    
    </tr>
    <tr>
      	<td colspan="3">jdoc:include type="modules" 
name="footer" /></td>    
    </tr>  
</table>

</body>
</html>

*********************************************
The result, like this:
2126057047_ba43c7547f=c
 
Leave a comment

Posted by on December 3, 2012 in joomla

 

Joomla – Template: Creating Layout (part 5)

Joomla Template Tutorial – Part 5: Before put content, we must design the blocks where module or component placed. In this posting, we use ‘classic’ HTML (I mean, use <table> not <div>).

Our layout target like following picture:

2126056703_0bd50e8522=a

Ok, open index.php within folder mytemplate. Enter following code:

*****************************************************************************

; <?
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<html>
<head>
</head>

<body>

<table width="100%" border="1" bgcolor="#FFFF00">
    <tr>
      	<td colspan="3">Top</td>    
    </tr>
    <tr>
      	<td colspan="2">User 3</td>    
      	<td>User 4</td>        
    </tr>
    <tr>
      	<td rowspan="2">Left</td>
      	<td colspan="2">
        	<table width="100%" border="1">
            	<tr>
                	<td>User 1</td>
                	<td>User 2</td>                
                </tr>
            </table>
        </td> 
    </tr>
    <tr>  
      	<td height="200">Component</td>
      	<td>Right</td>    
    </tr>
    <tr>
      	<td colspan="3">Footer</td>    
    </tr>  
</table>

</body>
</html>

    <br><br>	

<table id="recommend" border="0" cellpadding="2" cellspacing="2" width="100%"><tbody><tr><td id="boxlist"><span><b>Series this article:</b> <br></span><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P91.html" title="Joomla - Template: Understanding Basic Template (Part 1)">Joomla - Template: Understanding Basic Template (Part 1)</a></span><br><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P92.html" title="Joomla - Template: Understanding Module Position (Part 2)">Joomla - Template: Understanding Module Position (Part 2)</a></span><br><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P93.html" title="Joomla - Template: My First Template (Part 3)">Joomla - Template: My First Template (Part 3)</a></span><br><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P94.html" title="Joomla - Template: Activate Template (Part 4)">Joomla - Template: Activate Template (Part 4)</a></span><br><span id="boxlist"><b><font color="#666666">Joomla - Template: Creating Layout (part 5)</font></b></span><br><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P96.html" title="Joomla - Template: Using jdoc (part 6)">Joomla - Template: Using jdoc (part 6)</a></span><br><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P97.html" title="Joomla - Template: Using Parameters (Part 7)">Joomla - Template: Using Parameters (Part 7)</a></span><br><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P98.html" title="Joomla - Template: Place Text  (Part 8)">Joomla - Template: Place Text  (Part 8)</a></span><br><span id="boxlist"><a href="http://www.phpeveryday.com/articles/Joomla-Template-Creating-Layout-part-5--P99.html" title="Joomla - Template: Creating Preview Thumbnail (Part 9)">Joomla - Template: Creating Preview Thumbnail (Part 9)</a></span><br>  
<br>   

    <span>        
<!-- AddThis Button BEGIN -->
<a href="http://www.addthis.com/bookmark.php?v=250&pub=wsiswoutomo"><img src="http://s7.addthis.com/static/btn/v2/lg-bookmark-en.gif" alt="Bookmark and Share" style="border:0" height="16" width="125"></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=wsiswoutomo"></script>
<!-- AddThis Button END -->        
    Tag: <a href="http://www.phpeveryday.com/index.php?tag=joomla" title="joomla">joomla</a>, <a href="http://www.phpeveryday.com/index.php?tag=%20template" title=" template"> template</a> Category: <a href="http://www.phpeveryday.com/index.php?cat=40">Web Design</a>, <a href="http://www.phpeveryday.com/index.php?cat=3">PHP Framework</a> Post : December 13th 2007 Read: 33,557    </span>

		<br><br>
advertisements<br>
	<script type="text/javascript"><!--
	google_ad_client = "pub-4735205347314443";
	/* 728x90, dibuat 10/09/26 */
	google_ad_slot = "6120992890";
	google_ad_width = 728;
	google_ad_height = 90;
	//-->
	</script>
	<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	</script><ins style="display:inline-table;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px"><ins id="aswift_1_anchor" style="display:block;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px"></ins></ins>

<br><br>
<div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/phpeveryday/embed.js"></script><noscript><a href="http://disqus.com/forums/phpeveryday/?url=ref">View the discussion thread.</a></noscript>

	</td></tr>
	</tbody></table>
	<!--END OF ARTICLE-->   

 ***************************************
 
Leave a comment

Posted by on December 3, 2012 in joomla

 

Joomla – Template: Activate Template (Part 4)

Joomla Template Tutorial – Part 4: After create ’embryo’ joomla template, now, we try to activate the template. In Joomla, we make this template as default.

  1. Login to Joomla as administrator.
  2. Click Extensions > Template Manager.
  3. You can see template list like below:

2126056241_c704c97cbc=b

Choose mytemplate by click radio button in front of mytemplate.

2126056425_f5a251a59b=c

Click Default button on top.

2126832706_ab335fc3f6-d

Now, when you point your browser to localhost/joomla, you can see ‘nothing’. Yup, because template used has changed. Active template is mytemplate. But we don’t define anything in this template. So, we just see blank page.

 
Leave a comment

Posted by on December 3, 2012 in joomla

 

Joomla – Template: My First Template (Part 3)

Joomla Template Tutorial – Part 3: Now, we will build our first joomla template. We start from simplest layout. This posting focus on step by step creating simple joomla template.

  1. Open folder where joomla template placed. Assuming, the template folder within www/joomla/.2126832212_ec9377eeef
  2. Create folder, named “mytemplate”   .                      2126832380_743f0437f3==t
  3. Open mytemplate folder. Create a file name “index.php”.
  4. Create a file named “templateDetails.xml”. Enter following code:******************************
  5.  <?xml version=”1.0″ encoding=”utf-8″?>  <install version=”1.5″ type=”template”>  <name>mytemplate</name>  <version>1.0.0</version>  <creationDate>12/12/07</creationDate>  <author>Wiwit Siswoutomo</author>  <authorEmail>wsiswoutomo@yahoo.com</authorEmail>  <authorUrl>http://www.phpeveryday.com</authorUrl&gt;  <copyright></copyright>  <license>GNU/GPL</license>  <description>TPL_MY_TEMPLATE</description>  <files>    <filename>index.php</filename>    <filename>templateDetails.xml</filename>  </files>  <positions>    <position>breadcrumbs</position>    <position>left</position>    <position>right</position>    <position>top</position>    <position>user1</position>    <position>user2</position>    <position>user3</position>    <position>user4</position>    <position>footer</position>    <position>debug</position>    <position>syndicate</position>  </positions>  </install>                                                                                                                                                                                                                                                        When read above codes, you can guess, it is like metadata for this template. Content this XML file is about our Joomla template information.
 
Leave a comment

Posted by on December 3, 2012 in joomla