I'm trying to get the name of Content pages to show automatically. I'm using the contact.tpl file to show the content, as that is the only way I could figure out how to get the content to show, but the content page title shows CONTACT US on all content pages.
My contact.tpl: $sContentLeft
With $sContentLeft removed from contact.tpl it removes all content on the pages, but with it there, it shows the content but the title is contact us.
Anyone able to help?
I'm not exactly sure what it is that you are trying to achieve. The contact.tpl is there for the use of the Contact content page, which is the one content page that cannot be deleted. Why, and how, are you trying to use it for other content? What is the problem with simply adding a content page from Admin? [BTW what version QC?]
Ok, sorry I haven't explained it very well. Basically in the above linked page, I have changed the layout and design etc. When I add a new content page, i would like the bit that says CONTACT US to be "New Content Page Title"
Like this: http://images.agservegts.com.au/qchelp.gif I can't figure out what template file to put $aSite[sTitle] in (if that is the correct variable). Currently it's in the head.tpl
In regards to the
"With $sContentLeft removed from contact.tpl it removes all content on the pages, but with it there, it shows the content but the title is contact us."
in my previous post, I was referring to the contact.tpl file, and the variable "$sContentLeft", if that variable is removed then every content page has no information on it.
Hope I didn't confuse you toooo much. and thanks for your reply :)
Sorry, forgot to say QC version, I'm using 0.2.5
Robbo: I have no idea what the bottom of your index.php file looks like but mine looks like this (with line numbers add for my reference purposes):
Lines 6/7 and 11-14 are the error-handling code and the reason why you can't delete the Contact page: if there is a problem with $p, or it can't find content matching $p,it will display the Contact page ($p=0). Any content page must have one column - $sContentLeft - and can have 2 columns - $sContentRight - as defined by the template files columns_one.tpl and columns_two.tpl. Line 9 gets the main content, as entered in the textarea box via Admin. Assuming there's something in it, and its not going to default back to the Contact page, then you get down to line 24 which looks for a photo assigned to the content page (via Admin) and loads it into the second column ($sContentRight) if found. Lines 25-28 call either columns_one.tpl or columns_two.tpl depending on whether or not $sContentRight (the second column with the photo) has something in it. So basically, all content pages that you add via Admin use either columns_one.tpl or columns_two.tpl depending on exactly how much information you set for for the content page itself.
To get the title of the content page you need to make a couple of changes round line 9:
This does exactly what line 9 used to do, with the exception that the title of the content page is now accessible in $aFullContent['sTitle'] (if it found the page!). By making appropriate changes to columns_one.tpl and/or columns_two.tpl to include $aFullContent[sTitle] you get the title of the content page displayed!
Of course, all the above relates to an unmodified index.php so you may have to pick out the bones if you've made drastic changes!
Thanks for your very detailed reply, will have a play around with it all tomorrow!
Regards Rob :)
I have played around with the information, and edited the columns_*.tpl files to add $aFullContent[sTitle] into them, but where the title is meant to be, I get
instead of the actual title - this doesn't show on the ?p=productsList page, but does on the content pages ( ?p=p_2 )
Image is linked below, or you can have a look at it currently at http://test.agservegts.com.au
Take out the single quotes!
Thanks for your time and help Wizzud! Now working perfectly!