Dynamic header text in Artisteer generated Joomla templates

found at http://Artisteerhelp.com by Lance ยป Tue Mar 31, 2009 4:29 am

Disclaimer:
This procedure involves making changes to files within Artisteer. Please remeber to back up your original files and that if you decide to make these changes you do so at your own risk. Any updates or upgrades applied to the Artisteer program may overwrite these modifications.

What it does:
When you make these modifications, rather than Artisteer creating the static site name (Headline) and slogan (Slogan text) areas that have to be modified by editing the index.php file, all templates created in Artisteer will automatically get this information directly from Joomla. The best part about using this modification is that anyone using one of these templates can change the site name and slogan from within their Joomla administration panel.

First we want to open the following file folder: C:\Program Files\Artisteer 2\Library\Data\Templates\Joomla\Export\Glyphs

Look for this file: Logo.html

Open it with a text editor, you will see the following code:

<div class=”logo”></div>
<h1 id=”name-text” class=”logo-name”><a href=”&lt;?php echo $this-&gt;baseurl ?&gt;/”>{Name}</a></h1>
<!– END name –>
<!– BEGIN slogan –>
<div id=”slogan-text” class=”logo-text”>{Text}</div>
&nbsp;
We want to replace the following code:

Replace {Name} with < ?php echo $mainframe->getCfg(‘sitename’) ;?>

It then uses the global site settings information from “Site Name” to generate the site name.

Replace {Text} with < ?php echo $mainframe->getCfg(‘MetaDesc’) ;?>

It then uses the global site settings information from “Global Site Meta Description” to generate the site slogan.

This is how your code should look when completed:

Code: Select all
<div class=”logo”>

&nbsp;
<h1 id=”name-text” class=”logo-name”><a href=”&lt;?php echo $this-&gt;baseurl ?&gt;/”>&lt; ?php echo $mainframe-&gt;getCfg(‘sitename’) ;?&gt;</a></h1>
<!– END name –>
<!– BEGIN slogan –>
<div id=”slogan-text” class=”logo-text”>&lt; ?php echo $mainframe-&gt;getCfg(‘MetaDesc’) ;?&gt;</div>
&nbsp;

</div>

 

Save the file and your all set. Here is an example of the finished product:

Should you decide that you don’t want to modify any files within Artisteer you can use the two pieces of replacement code within your index.php file to accomplish the same thing.