Page title tag

20 posts by 2 authors in: Forums > CMS Builder
Last Post: July 2, 2008   (RSS)

Re: [chassa2556] Page title tag

By Dave - June 23, 2008

As chassa2556,

You'd do that the same way you'd let them modify any other section of field. Just load your record at the top of the page and then insert the values like this:

<title><?php echo $record['pageTitle']; </title>

Hope that helps! Let me know if you need more help with that.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Page title tag

By chassa2556 - June 23, 2008

the title I need to change is the browser window title together with the meta tag information rather than the page title you suggest. I need to optimise it for the search engines so need to be able to adjust this 'hidden' header tag information.

Re: [chassa2556] Page title tag

By Dave - June 23, 2008

You can create a separate field called 'browserTitle' if you like, just display it inside the <title></title> tags it will change the browser window title.

Along the same lines, you can create some fields for meta tag information as well.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Page title tag

By chassa2556 - June 23, 2008

sorry being a bit dim here could you tell me what that code would be?

Re: [chassa2556] Page title tag

By Dave - June 23, 2008

Hi Charles,

The first step is to create a new field for the section you want it to appear it. So say your section is called "Pages". You would go into: Admin > Section Editors > Pages and add a new textfield called "pageTitle".

Then if you check it should show up in the editor, and you should be able to enter values for it. Do that for PageTitle as well as "Meta Keywords" and "Meta Description". Once you've got that far I'll help you with the next step.

Hope that helps! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Page title tag

By chassa2556 - June 25, 2008

Hi Dave

I've done this now have set up text fields for pageTitle, meta keywords and description. What should I do now please?

Re: [chassa2556] Page title tag

By Dave - June 25, 2008

Ok, you'll have tags in your viewer page that look like this: <?php echo $record['fieldname']; ?> but they'll have a different name other than record such as $newsRecord or $jobRecord depending on what section it is.

Use that variable name and add a tag to display your new field like this:

<title><?php $yourVariable['pageTitle']; ?></title>

Let me know how that goes. If you get any errors feel free to attach your viewer page and I can take a look for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Page title tag

By chassa2556 - July 1, 2008

Hi Dave

Have now done this and it works thanks!

I have also set fields called 'metakeywords' and 'meta_description' for meta information that the client would like to be able to update. Could you tell me how I would add this code?

Many thanks

Re: [chassa2556] Page title tag

By Dave - July 1, 2008

Glad to hear it's working for the title tags. The meta tags are almost the same:

Use the variable name and add a tag to display your new fields like this:

<META NAME="Description" CONTENT="<?php $yourVariable['meta_description']; ?>">
<META NAME="KeyWords" CONTENT="<?php $yourVariable['metakeywords']; ?>">

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com