Using titles in header file

5 posts by 3 authors in: Forums > CMS Builder
Last Post: May 23, 2009   (RSS)

By Thomas - May 18, 2009

Hi,

Is it possible to use the title of the page in a generic site wide header file?
I have managed to get this working with all pages in a category but any other categories it will not work.

For example:

http://76.163.37.133/ivf/index.php?RBA-History-4
Works and includes 'RBA HISTORY' in the title

http://76.163.37.133/ivf/newslist.php
Does not include a title instead 'Notice: Undefined variable: pagesRecord in .../rba-online.com/ivf/header.php on line 6'

http://76.163.37.133/ivf/news.php?Breakthrough-in-Egg-Freezing-1
This is a different category too, again no title.

Is there a work around I can use?

Thanks

Re: [Thomas] Using titles in header file

By ross - May 19, 2009

Hi Thomas

Thanks for posting!

You can have a generic site wide header that is easy to change. What you'll want to do though is just create a new single page section in your admin. You can call it Globals or something like that. It doesn't really matter.

In that section, create one field called Header (it can be a textfield).

Then all you need to do is put its viewer code on each of your pages and all the titles can be the same for your site.

Does that make sense? Does it sound like that would work for you?

Let me know :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [Thomas] Using titles in header file

By zip222 - May 19, 2009

replace your header.php file with this...

<?php if($pagesRecord['title']): ?>
<title><?php echo $pagesRecord['title'] ?></title>
<?php else: ?>
<title>GENERIC TITLE</title>
<?php endif; ?>

Re: [jdancisin] Using titles in header file

By Thomas - May 23, 2009

Thank you jdancisin,
I'll give that a try