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

Better Meta help

Development and Programming

Wired's avatar
Wired
181 posts
17 years ago
Wired's avatar Wired

I cant seem to pass the entry’s meta information to it’s respective page. I have this snippet in my embeded header template: {exp:lg_better_meta entry_id=”{embed:entry_id}” weblog_id=”{embed:weblog_id}” url_title=”{embed:url_title}” title=”{embed: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}” }

When I check the source, I get the site’s meta information. I also tried passing the parameters without the embed method and no luck.

       
Simon Cox's avatar
Simon Cox
405 posts
17 years ago
Simon Cox's avatar Simon Cox

I just installed Better Meta and added meta data for each page but each page is showing the site default meta instead of the individual page meta where different.

I am using the basic tag {exp:lg_better_meta} in my header embed.

I don’t think Leevi does support for this though unless you purchase the full version.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Have you tried using :

{exp:lg_better_meta url_title="{segment_3}"}

instead? You will need to change the {segment_3} part (possibly) to reflect where the url_title is in your respective cases but that should hopefully do it?

Also even though Leevi does charge for a version where you can take off the attribution from the code he is still very helpful to those that haven’t paid 😉

Don’t know if that helps at all?

Best wishes,

Mark

       
Simon Cox's avatar
Simon Cox
405 posts
17 years ago
Simon Cox's avatar Simon Cox

Thanks Mark - I was forgetting that it is or course in the head and how will Better Meta know which page its on!

I have pages that need segment 2 and a few that use segment 3 as well. Just tried “if” conditionals but cant get it to work other than the later segments - doesn’t make sense at teh moment - need to give it some attention tonight when I get home.

       
Simon Cox's avatar
Simon Cox
405 posts
17 years ago
Simon Cox's avatar Simon Cox

OK I had to do this to differentiate between a section home page and its sub pages.

{if segment_3}
    {exp:lg_better_meta url_title="{segment_3}"} 
    {if:else}
    {exp:lg_better_meta url_title="{segment_1}"} 
    {/if}

Now I have remaining one page that does not have the same title as its URL segment 1! Need to sort that out as its defaulting to the site meta.

Anyone got a better way of doing this?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hi Simon,

Not too sure why you need conditionals although it does obviously depend on the way you have your site setup but if you are using different templates for each single entry page then you are really only going to need to place the correct {segment_x} variable into each template I would have thought so if you say have a single entry page that uses say media/details/url_title_here then you would use :

{exp:lg_better_meta url_title="{segment_3}"}

if however you have a page such as news/information then you would just use

{exp:lg_better_meta url_title="{segment_2}"}

inside the template. Of course as I said above it does all really depend upon your site layout but it should all work.

Let us know how you get on.

Best wishes,

Mark

       
Wired's avatar
Wired
181 posts
17 years ago
Wired's avatar Wired

I was freaking excited when I figured it out last night. I was pulling my hair out trying to figure it out. Simon try creating a different header template and embed it for the entries you want your desired results.

Thanks mark for your help. Your wealth of knowlege is priceless.

       
Simon Cox's avatar
Simon Cox
405 posts
17 years ago
Simon Cox's avatar Simon Cox
Hi Simon, Not too sure why you need conditionals although it does obviously depend on the way you have your site setup

Yes Mark this particular site uses a different template group for each section of the site and one section has a bunch of pages in it - hence the need for segment_1 and segment_3 calls.

This navigation type does make sense in some situations and the conditional works just fine!

Wired - good to hear you have it working to!

       
Wired's avatar
Wired
181 posts
17 years ago
Wired's avatar Wired

I might try that contional statement to see how well that does.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen
Thanks mark for your help. Your wealth of knowlege is priceless.

Well I wouldn’t go that far 😉 but thanks for the kind words!! 😊

Yes Mark this particular site uses a different template group for each section of the site and one section has a bunch of pages in it - hence the need for segment_1 and segment_3 calls. This navigation type does make sense in some situations and the conditional works just fine! Wired - good to hear you have it working to!

Glad the conditional is working for you. Like you say different sites do need differing ways of getting things done but the segment variables are definitely your friend on this one. Any more problems just give a shout! 😉

Best wishes,

Mark

       
Todd D.'s avatar
Todd D.
460 posts
16 years ago
Todd D.'s avatar Todd D.

I’m trying to get a handle on this issue.

I have many templates throughout my site that reference and embedded header template…

{embed="embeds/html_header" page_title="My Page Title"}
<body>

Where and how am I supposed to tell Better Meta what page its’ on? The embedded template?

My html_header template looks like…

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{exp:lg_better_meta entry_id="{embed:entry_id}"
    weblog_id="{embed:weblog_id}"
    url_title="{embed:url_title}"
    title="{embed: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}"
}
</head>

All I get now are the default values for the site. What do I need to change?

Thanks for any help!

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

You’ll need to pass either the entry_id or url_title to your embeded template.

There is an example here: http://leevigraham.com/cms-customisation/expressionengine/lg-better-meta/#embedded-templates

and more specific cases here: http://leevigraham.com/cms-customisation/expressionengine/lg-better-meta/#outputting-entry-meta-data

The examples above use LG Better Meta 1.7.0

Hope that helps

       
Todd D.'s avatar
Todd D.
460 posts
16 years ago
Todd D.'s avatar Todd D.

I would try that… but I can’t find the documentation for the upgrade process from 1.61 to 1.7. In fact, I can’t find ANY documentation for 1.61.

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

Documentation for v1.6 can be found here. I would recommend upgrading to v1.7 as it fixes a couple of bugs, improves speed and adds a sitemap generator.

       

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.