Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Page title tag

 

 


chassa2556
User

Jun 23, 2008, 2:52 AM

Post #1 of 20 (1144 views)
Shortcut
Page title tag Can't Post

Could you tell me how to allow a user to adjust the title tag and meta tag information within CMSB


Dave
Staff / Moderator


Jun 23, 2008, 9:41 AM

Post #2 of 20 (1098 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

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


chassa2556
User

Jun 23, 2008, 10:57 AM

Post #3 of 20 (1084 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

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.


Dave
Staff / Moderator


Jun 23, 2008, 12:57 PM

Post #4 of 20 (1067 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

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


chassa2556
User

Jun 23, 2008, 1:51 PM

Post #5 of 20 (1065 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

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


Dave
Staff / Moderator


Jun 23, 2008, 4:23 PM

Post #6 of 20 (1051 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

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


chassa2556
User

Jun 25, 2008, 2:59 PM

Post #7 of 20 (1021 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

Hi Dave

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


Dave
Staff / Moderator


Jun 25, 2008, 3:43 PM

Post #8 of 20 (1019 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

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


chassa2556
User

Jul 1, 2008, 7:20 AM

Post #9 of 20 (971 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

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


Dave
Staff / Moderator


Jul 1, 2008, 8:18 AM

Post #10 of 20 (967 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

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


chassa2556
User

Jul 1, 2008, 8:48 AM

Post #11 of 20 (958 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

Have put this after the title tag like this:

<title><?php echo $pagesRecord['pagetitle'] ?></title>
<META NAME="Description" CONTENT="<?php $pagesRecord['meta_description']; ?>">
<META NAME="KeyWords" CONTENT="<?php $pagesRecord['metakeywords']; ?>">

But it doesn't seem to work even though the title tag does. When I go to view source the meta tags aren't there.

Any ideas?


Dave
Staff / Moderator


Jul 1, 2008, 10:44 AM

Post #12 of 20 (941 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

The meta tags aren't there or the content of the meta tags aren't there? Try adding something else to the page and then look for it in view source to make sure you're editing the right file. If that works double check you have values saved for the record for meta_description, and metakeywords.

Dave Edis - Senior Developer
interactivetools.com


chassa2556
User

Jul 2, 2008, 5:49 AM

Post #13 of 20 (894 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

This is the code

<title><?php echo $pagesRecord['pagetitle'] ?></title>
<META NAME="KeyWords" CONTENT="<?php $pagesRecord['metakeywords']; ?>">
<META NAME="Description" CONTENT="<?php $pagesRecord['meta_description']; ?>">

...and this is what I get in the source code - note the title tag works.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META NAME="Description" CONTENT="">
<META NAME="KeyWords" CONTENT="">
<title>The Dower House, Straloch estate</title>

<style type="text/css">


Dave
Staff / Moderator


Jul 2, 2008, 9:09 AM

Post #14 of 20 (881 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

Hi Charles,

Try adding this temporarily to see all the available fields:

<xmp><?php print_r($pagesRecord); ?></xmp>

Let me know what that says.

Dave Edis - Senior Developer
interactivetools.com


chassa2556
User

Jul 2, 2008, 9:11 AM

Post #15 of 20 (878 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

Sorry not with you there Dave?


Dave
Staff / Moderator


Jul 2, 2008, 9:14 AM

Post #16 of 20 (876 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

Try adding the following tag (in red) just below your body tag. It will display a list of all the fields that are available. It's very odd that nothing is showing for metakeywords and meta_description.


Code
<title><?php echo $pagesRecord['pagetitle'] ?></title> 
<META NAME="KeyWords" CONTENT="<?php $pagesRecord['metakeywords']; ?>">
<META NAME="Description" CONTENT="<?php $pagesRecord['meta_description']; ?>">
...
<body>

<xmp><?php print_r($pagesRecord); ?></xmp>


Once you add that it will display a list of all the available fields in $pageRecord. Just copy and paste that and then remove the tag again.

Dave Edis - Senior Developer
interactivetools.com


chassa2556
User

Jul 2, 2008, 9:31 AM

Post #17 of 20 (873 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

I've run out of time on this job - I wonder could I ask you to fix it for me Dave? You have my details with straloch.com


Dave
Staff / Moderator


Jul 2, 2008, 9:46 AM

Post #18 of 20 (872 views)
Shortcut
Re: [chassa2556] Page title tag [In reply to] Can't Post

Sure, I can have a look. Just email me at dave@interactivetools.com the url to this page you're having trouble with.

Dave Edis - Senior Developer
interactivetools.com


Dave
Staff / Moderator


Jul 2, 2008, 1:24 PM

Post #19 of 20 (855 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

We figured this one out. I had missed the echo in the PHP tag:

<title><?php echo $pagesRecord['pagetitle'] ?></title>
<META NAME="KeyWords" CONTENT="<?php echo $pagesRecord['metakeywords']; ?>">
<META NAME="Description" CONTENT="<?php echo $pagesRecord['meta_description']; ?>">

It working now. And whenever you need to add new tags you can always use the code generator to create a list of them and just copy and paste the ones you need. It never forgets the echo part! :)

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


chassa2556
User

Jul 2, 2008, 1:43 PM

Post #20 of 20 (853 views)
Shortcut
Re: [Dave] Page title tag [In reply to] Can't Post

Thanks for fixing it Dave

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4