Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
Meta tags

 

 


richc
User

Sep 8, 2009, 5:16 PM

Post #1 of 4 (2314 views)
Shortcut
Meta tags Can't Post

I have added fields on all my pages and listings for meta title and meta description, but having trouble getting these to display in the header.

<title><?php echo $homepageRecord['metatitle'] ?></title> would work fine for the homepage but not for the listings or other pages. I guess I could use IF statements (or a CASE??) but I'm sure there is a better way?


Donna
Staff / Moderator


Sep 10, 2009, 1:03 PM

Post #2 of 4 (2305 views)
Shortcut
Re: [richc] Meta tags [In reply to] Can't Post

Hi Rich,

I'm not quite sure what you're asking for. On a list page, what would you like to appear? Since there can be more than one result, you wouldn't be able to put the title in ... because which title would it pick?

Usually on list pages, you would hardcode the title, then on detail pages, you could have whatever title you wanted to appear.

Let me know more details about how you're trying to set that up. :)

Donna

--
support@interactivetools.com


richc
User

Sep 10, 2009, 5:14 PM

Post #3 of 4 (2301 views)
Shortcut
Re: [Donna] Meta tags [In reply to] Can't Post

I have set up fields called metatitle and metadescription and they read in nicely for all the pages yopu can edit them, but not as you said for the listings page itself.

I've just found the "default value" and I guess that would work, but I'd prefer to have individual ones as I have several listings pages for separate categories ... so what I need is some code to add to the include_header file:

if you are this listing page use this description
if you are that listing page use that description
otherwise use the supplied one from $metadescription

???

Thanks


Chris
Staff


Sep 22, 2009, 12:50 PM

Post #4 of 4 (2128 views)
Shortcut
Re: [richc] Meta tags [In reply to] Can't Post

Hi richc,

Do you have a "categories" section? If so, you could add metatitle and metadescription fields to that too and use an IF...ELSEIF...ELSE to display a field whichever record is available or a hard-coded default.

I hope that helps! :)
Chris


(This post was edited by chris on Sep 22, 2009, 12:50 PM)