Page 1 of 1

Add a new Content type in template [Solved]

Posted: Tue May 15, 2007 2:09 pm
by EffectiveSites

Code: Select all

<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="HAPedit 3.1">
{stylesheet}
{metadata}
</head>
</__body>
<div id="container">
	<!--Header section-->
	
  	<div id="header"> 
    	
    <div id="rightHeader"></div>
                 <H1 class="MainHeading">Atlas Construction</H1> <!-- ***** How do I make this heading be different on each page?-->
		<img id="logo" src="../Images/atlasterexLogo2.gif" alt="ATLAS-TEREX logo"> 
		<div id="navAddress">
			<span>Atlas CM, Rathangan, Co. Kildare +353 (0)45-528796</span> 
	  		<h3 class="tagline">Sole distributors for Atlas Terex Excavators in Ireland</h3>
		</div>
  	</div>	
	<!--Content section-->
	<div id="wrapper">
		<div id="content">{content}
		</div>
	</div>

The above is my template. The tag {content} gets replaced by the content in each page - that works fine. What I would like is to have is a similar way to show the "MainHeading" on each page?? I know that I can create a global content block but that will just insert the same text on each page. I want to have the heading be "Products" on the products page and "Services" on the services page etc. How do I do that?

I've spent ages reading the site to try find the answer so I'd really appreciate any pointers..

Re: Add a new Content type in template [SOLVED]

Posted: Tue May 15, 2007 2:36 pm
by EffectiveSites
Hi all,
I was def making this more complicated than it was! I just changed the code in the template to:

Code: Select all

<H1 class="MainHeading">{content block="MainHead" oneline='true'}</H1>
Then when I went to one of the pages - there was the main text area for adding the content and then underneath this there was a textfield called 'MainHeading'. So I just entered the heading I wanted for that page.

Hope this helps someone else.

Re: Add a new Content type in template [Solved]

Posted: Tue May 15, 2007 8:40 pm
by calguy1000
you could also have used the {$page_title} variable.
{$page_title}

the {get_template_vars} plugin can be used to tell you what variables smarty knows about that you can use in your template.