We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Metadata: Page Title

Development and Programming

K.Brown's avatar
K.Brown
89 posts
16 years ago
K.Brown's avatar K.Brown

I’m using the following code as my meta template inside an embed header template…

This works for my blog posts, but for pages that don’t have a segment_3, it doesn’t work… ie. url.com/contact

Is there an easy way to either override a few pages with a fixed title, or use segment_2 for pages that don’t have segment_3?

{exp:lg_better_meta_pi:template
    entry_id="{embed:entry_id}"
    weblog_id="{embed:weblog_id}"
    url_title="{segment_3}"
    title="{embed:title}"
    title_suffix="{embed:title_suffix}"
    title_prefix="{embed:title_prefix}"
    hide_site_title="{embed:hide_site_title}"
    description="{embed:description}"
    keywords="{embed:keywords}"
    author="{embed:author}"
    publisher="{embed:publisher}"
    rights="{embed:rights}"
    date_created="{embed:date_created}"
    date_modified="{embed:date_modified}"
    date_valid="{embed:date_valid}"
    identifier="{embed:identifier}"
    robots_index="{embed:robots_index}"
    robots_follow="{embed:robots_follow}"
    robots_archive="{embed:robots_archive}"
  }

Thanks!

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

I always add the {exp:lg_better_meta_pi:template} code to an embeded head element.

Then in individual templates you can add:

{embed="_includes/.head" url_title="{segement_3}"} or
{embed="_includes/.head" url_title="{segement_2}"} or
{embed="_includes/.head" entry_id="{segement_3}"} or
{embed="_includes/.head" title="About Us | Contact"}
       
K.Brown's avatar
K.Brown
89 posts
16 years ago
K.Brown's avatar K.Brown

Hey! That’s awesome!

Leevi, thanks for making some freakin’ awesome stuff! If you were here I’d give you a hug.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.