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 ...
|
|||||||
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
||||
|
||||
|
Quote:
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 |
|
#4
|
||||
|
||||
|
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. |
|
#5
|
||||
|
||||
|
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 |
|
#6
|
||||
|
||||
|
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 |
|
#7
|
||||
|
||||
|
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 |
|
#8
|
||||
|
||||
|
Quote:
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. |
|
#9
|
||||
|
||||
|
Quote:
{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:
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 |
|
#10
|
||||
|
||||
|
Quote:
Ah, it won't let me... |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |