You are here: Home arrow Joomla Web Design Tips arrow Extracting the Site Name

Joomla Theme

Joomla Themes Web design Free Templates

Extracting the Site Name

Every wanted to extract the Joomla site name from the global configuration.php file so it gets displayed in your template.

Well this is how you can do it.

1) Open the template index.php file in notepad.exe or an editor of your choice.

2) Add the following line of code in your template index.php file where you would like the title to appear.

  <div class="sitename"><h1><?php echo $mosConfig_sitename; ?></h1>

3) Basically the above code is referencing a div class plus applying the H1 tag to the site title. The

 <?php echo $mosConfig_sitename; ?> The <?php echo $mosConfig_sitename; ?>  is used to automatically extract the site name from the global configuration file and apply it your template index.php file.

4) Now we need to apply a style to the Div class site name plus the H1 tags so you can control the way your site title will look.

5) Open the template_css.css file using note pad and add the following code.

.sitename { color: #FFF; padding-top: 20px; padding-left: 50px; }

h1 {
 padding-left: 5px;
 padding-top: 0px;
 font-family: Arial, Verdana, Helvetica, sans-serif;
 font-size: 17px;
}

6) The above css code will control the position of the div class called <div class="sitename">and apply a style to the H1 tag.

7) So the style applied to the .sitename is FFF ( white color ) and then you are positioning the title with padding-top :20px and padding-left:50px.

8) With the H1 tag to are applying a font style of Arial, Verdana, Helvetica, sans-serif; and font size of 17px plus adding padding-left: 5px;

Your Joomla site name will now be automatically displayed in your template.

Powered by Joomla Tags

 
< Prev   Next >