CUSTOM PAGE TITLE USING "title" & "subtitle" fields on current page?

4 posts by 3 authors in: Forums > CMS Builder
Last Post: April 29, 2013   (RSS)

By gkornbluth - April 23, 2013

Hi Tina,

What code are you using and could you rephrase the issue you're having (I don't quite understand)?

What do the title and subtitle do now, and what do you want them to do.

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By csdesign - April 23, 2013

Hi Jerry, 

Sure thing! 

I would like to be able to control the Title in the Meta Tags on the include_header.php page. 

In the Title tag in the meta tags, I would like to be able to use 2 already populated fields in a Single page record, Multi Page Record listing page or multi-page Details pages. 

Here's a test page for reference: 
http://www.superiorequinesires.com/stallion.php?DONNERHALL---TESTING-2

On this page/record, the page Title is "Donnerhall - Testing" and the page subtitle is "Oldenburg" (breed). 
I would like the page Title and the page Subtitle to be included in the title that appears at the top of the browser window (on sample page, it currently reads "superior equine sights/sires". 

I'd like it to read:  "Donnerall, Oldenburg, Superior Equine Sires"  by having the meta tag title automatically use my page title and page subtitle of that specific page only. (changes by page)

That's where I came up with this: 

<title><?PHP echo $pagesRecord['title']; ?>,<?PHP echo $pagesRecord['subtitle']; ?>Company Name Here</title>

Does that make more sense?  Thanks! Tina

By gregThomas - April 29, 2013

Hi Tina, 

Did you resolve this issue? If not what about using something like this:

<?php $metaTitle = (@$pageRecord)?  $pagesRecord['title'].','.$pagesRecord['subtitle'].'Company Name Here' : 'Alternative title text here'; ?>
<title><?phg echo $metaTitle; ?></title>

So if $pageRecord is set before include_header.php is included, then in include_header you could detect if $pageRecord has been set, and if it hasn't display an alternative header instead, which in this example would be Alternative title text here.

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com