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 csdesign - April 22, 2013

Hello!  

I pulled the code I needed from the cmscookbook but I have a question.  I've tried, but can't get this to work.  

I would like the page title to come from the field "title" and "subtitle" on any given page (detail page, list page & single record pages)

Can I somehow make $pagesRecord generic so it would just pull the title from whichever page that showing in the browser?

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

My meta tag data is currently in my "include_header.php" file.
If there is a way to do this, I'm assuming I could do the same with the description and keyword fields also. 

Thanks so much!! Tina

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