How To Make Each Page Have A Unique Name, Desc & Keywords

This is a discussion on How To Make Each Page Have A Unique Name, Desc & Keywords within the v3.1 Questions & Support forums, part of the v3.1 Legacy Help & Support category; I want to have my listings get crawled by google and they recommend that each page of my site have ...


Go Back   68 Classifieds Forums > v3.1 Legacy Help & Support > v3.1 Questions & Support

 
LinkBack Thread Tools Display Modes
  #1  
Old 09-13-2006, 10:23 PM
bgordon's Avatar
Senior Member
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 157
Rep Power: 13
Default How To Make Each Page Have A Unique Name, Desc & Keywords

I want to have my listings get crawled by google and they recommend that each page of my site have a unique name, description and keywords. How do I change the name of the pages since they all get dynamically named by the layout PHP. Same thing goes with the descrition and keywords. I don't want the whole site (every page) with the identical name, desc and keyworks.

Any idea? Does this make sense?

I would have posted this in the mods section but it seems I don't have the authority to make a new post there.

__________________
B.Gordon
v.3.1.5 Developer
www.canadaboatshopper.com
Canada Boat Shopper - Boats For Sale By Owner In And Around Canada
Reply With Quote
  #2  
Old 09-13-2006, 10:33 PM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,132
Rep Power: 57
Default

The seo module will take that a long way. It gives unique names to each category and listing. If you know what you are doing you can modify the .htaccess to change the names of some pages to better suit your needs. You'd also have to change some of your links to these pages.
__________________
Regards,

John


�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
  #3  
Old 09-14-2006, 12:25 AM
bgordon's Avatar
Senior Member
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 157
Rep Power: 13
Default

Quote:
Originally Posted by juven14 View Post
The seo module will take that a long way. It gives unique names to each category and listing. If you know what you are doing you can modify the .htaccess to change the names of some pages to better suit your needs. You'd also have to change some of your links to these pages.
I have the SEO mod in place and it works great for the page name but I want a unique page title, description and keywords in the metatags. By default that stuff is pumped in by the variables in the main template. If I modify the template to use static values, I am in the same pickle.

I want to define a new variable for each page and have that assigned. Can we just call the pagename from the SQL database and use it as the page's title... I can live with repeated desc and keywords I suppose but the page's title in the head seems to be important in getting all the pages (items) listed in the search engines... seems they ignore multiple pages with identical meta tags...

Any idea oh guru?
__________________
B.Gordon
v.3.1.5 Developer
www.canadaboatshopper.com
Canada Boat Shopper - Boats For Sale By Owner In And Around Canada
Reply With Quote
  #4  
Old 09-14-2006, 09:14 AM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,132
Rep Power: 57
Default

I'm not to sure how you would go about that with the designer version. You could test for various details with smarty

If $type = categoryid
then title = some new value

If $listingtitle = id
then title = viewing listing title

There is only a handfull of pages that are actually important to the search engines since they can't modify ads, join, etc.

You will of course need to find unique variables for each page to test for.
__________________
Regards,

John


�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
  #5  
Old 09-14-2006, 09:24 AM
Moderator
 
Join Date: Mar 2006
Posts: 3,736
Rep Power: 91
Default

I did something similar for the old version using just the template language. It was essentially an include that was placed in the layout with a serious of logic checks to determine the body of the page currently viewed and would display meta data accordingly.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #6  
Old 09-14-2006, 09:27 AM
bgordon's Avatar
Senior Member
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 157
Rep Power: 13
Default

What about something like this... I know the variable names are wrong, but just illustrating a concept:

In the layout template where the page title occurs, could I use something like {$pPageTitle | default:null} - {$sitetitle}

I think that pPageTitle is the SQL field name... can I just call it or do I have to assign it...

If this would work, could you give me an example using real syntax?
__________________
B.Gordon
v.3.1.5 Developer
www.canadaboatshopper.com
Canada Boat Shopper - Boats For Sale By Owner In And Around Canada
Reply With Quote
  #7  
Old 09-14-2006, 10:08 AM
Moderator
 
Join Date: Mar 2006
Posts: 3,736
Rep Power: 91
Default

Basically what I would do is in the layout.tpl.php file I would replace the following with a smarty include.....

<title>{$title}</title>
<meta name="Keywords" content="{$sitekeywords}" />
<meta name="Description" content="{$sitedescription}" />

Since the variables used varies from page to page you will need to do visit your different page types and make note of variables used that can be checked via logic to identify the page then simply state the desired jeywords, content and title, or append to the existing title.

For example on your more static pages like home, pages, about etc you can check the $body variable.

For categories you can use the $body variable as a means of determining if you looking at a category or subcategory page and the breadcrumb variable to determine the actual category being viewed.

When viewing a listing you can once again checl the $body variable to see if its viewlisting.tpl.php and if it is you know a listing is being viewed and can then use the listing variables such as listing title etc for keywords.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #8  
Old 09-14-2006, 10:14 AM
bgordon's Avatar
Senior Member
 
Join Date: Aug 2006
Location: Georgian Bay, Ontario Canada
Posts: 157
Rep Power: 13
Default

Quote:
Originally Posted by Lhotch View Post
Basically what I would do is in the layout.tpl.php file I would replace the following with a smarty include.....

<title>{$title}</title>
<meta name="Keywords" content="{$sitekeywords}" />
<meta name="Description" content="{$sitedescription}" />

Since the variables used varies from page to page you will need to do visit your different page types and make note of variables used that can be checked via logic to identify the page then simply state the desired jeywords, content and title, or append to the existing title.

For example on your more static pages like home, pages, about etc you can check the $body variable.

For categories you can use the $body variable as a means of determining if you looking at a category or subcategory page and the breadcrumb variable to determine the actual category being viewed.

When viewing a listing you can once again checl the $body variable to see if its viewlisting.tpl.php and if it is you know a listing is being viewed and can then use the listing variables such as listing title etc for keywords.

OK... so what does a smarty include look like? Since the SQL table contains a field called pPageTitle, that I could use... do I simply replace the {$title} with {$pPageTitle} or do I have to write some code to assign $pPageTitle in smarty the value of $pPageTitle in the SQL database...

And for the listings, I assume what you mean is that the variables are relative to the php template. I mean that a variable like $listingTitle would not produce any data if I call it in a template that does not show listings right
?

What I am trying to do is get the listing title and short desc into the meta tags... This should help the search results in google etc? Is nobody else doing this?
__________________
B.Gordon
v.3.1.5 Developer
www.canadaboatshopper.com
Canada Boat Shopper - Boats For Sale By Owner In And Around Canada

Last edited by bgordon; 09-14-2006 at 10:21 AM.
Reply With Quote
  #9  
Old 09-14-2006, 11:11 AM
Moderator
 
Join Date: Mar 2006
Posts: 3,736
Rep Power: 91
Default

Quote:
Originally Posted by bgordon View Post
OK... so what does a smarty include look like? Since the SQL table contains a field called pPageTitle, that I could use... do I simply replace the {$title} with {$pPageTitle} or do I have to write some code to assign $pPageTitle in smarty the value of $pPageTitle in the SQL database...
A smarty include simply means to create an external template file and call or include it in place of the text I showed above in the default layout.tpl.php file. For example delete the 3 lines I have above and in there place put the following line....

{include file='keywords.tpl.php'}

Then in the keywords (just a random name I chose) you would have the logic to determine what page is being viewed and display a custom site title, site keywords and site description.

As for $pPageTitle, Im not sure I am following you here. Whats in the database doesnt really matter unless you going to add custom DB calls. Id simply recommend working with variables that are already present.


Quote:
Originally Posted by bgordon View Post
And for the listings, I assume what you mean is that the variables are relative to the php template. I mean that a variable like $listingTitle would not produce any data if I call it in a template that does not show listings right
?

What I am trying to do is get the listing title and short desc into the meta tags... This should help the search results in google etc? Is nobody else doing this?
The first thing I would recommend is adding {debug} to the top of your layout.tpl.php file. This will show you the variables being passed from the scripts to the templates via a popup window as you navigate the site.

Make a note of your links in navigation and which ones you want to have custom title/keyword/descriptions.

Next, move to a category and note the $body variable or even the scriptname variable and $breadcrumb variable. You can use these to determine if your viewing a category and if so the category name and encorporate them in the keywords/description.

By default as you view a page the page title is appended to the site title at the script level and assigned to the template variable {$title}, you can leave that be or alter it as you see fit.

For the keywords and description however you may want to append the ads title or perhaps some of the ad fields to them.

So in the include file that does the logic to determine where you are you could have something like this....

{if $SCRIPT_NAME == "category.php"}
{foreach name=outer item=contact from=$breadcrumb}
{foreach item=item from=$contact}
{assign var=category value=$item|strip_tags}
{/foreach}
{/foreach}
{/if}

What the above will do is check if the script name is category.php and if it is it will then loop through the bradcrumb array and assign the last element of the array to the variable category. This variable can then be used in the keywords/description etc.

For actual listing you are correct, you can check (like I did above) for the script name, if its viewlisting.php you know you are looking at a listing. You can use the breadcrumb to pull out the actual category if you want to include that and then since you know your viewing a listing you will have the ad variables themselves to use as well.

You are going to need to have logic (ie if/elseif etc) to check for all the pages you want custom titles/keywords/descriptions on and what you do within each section will vary debending on the content of the pages and whats available to use.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #10  
Old 09-14-2006, 12:56 PM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,132
Rep Power: 57
Default

Quote:
Next, move to a category and note the $body variable or even the scriptname variable and $breadcrumb variable. You can use these to determine if your viewing a category and if so the category name and encorporate them in the keywords/description.
That's a good one Larry, I didn't even think of seeing which template is being called or using $SCRIPT_NAME. I like the breadcrumb check too. I'll have to add to your karma on that one!

Ah, it won't let me...
__________________
Regards,

John


�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
can I run scripts in an content page? dawyatt v3.1 Questions & Support 11 06-22-2007 03:50 PM
Unique page id Acpjax v3.1 Questions & Support 9 11-14-2006 09:01 AM
Problem getting page title flyingpylon v3.1 Questions & Support 5 10-19-2006 02:15 PM
How do i make the classifieds my home page? sbuell20 v3.1 Modules & Modifications 2 08-04-2006 11:31 PM
Make and Model for auto web sites. igor81 v3.0 Questions & Support 4 04-18-2006 05:24 PM


All times are GMT -4. The time now is 02:41 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22