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 Better Meta, titles & Category Titles

Development and Programming

vorari's avatar
vorari
40 posts
17 years ago
vorari's avatar vorari

Eh…

Happy 4th of July. In the UK - so easy to forget. 😊

Hi Folks,

I have checked the forums and couldn’t seem to find anything on this. I have it working on 90% of my site - but the one area where I thought I’d be golden is actually confusing me. And this may have to do with my knowledge of segments and how EE processes them. I read Lisa’s well written importance of semantics and tried to process it as best I could.

Given that we normally have /TemplateGroup/Template == /Segment_1/Segment_2

How do blog categories and their associated <title></title> fit into this? I call my blog latest_news.

So I have /Latest_News/index as /TemplateGroup/Template.

Now… Categories!!

I have the following:

/latest_news/index/C/Blog —> /latest_news/C/Blog /latest_news/index/C/Events —> /latest_news/C/Events /latest_news/index/C/etc…

Where “C” is the reserved trigger for category and Blog, Events, etc.. after “C” are the category names.

When I click on a given entry underneath a category - no problem. Life is good.

Eg: /TemplateGroup/Template/C/Blog/entry_name (Single Entry)

But if I just select the category parent, I get nothing.

Eg: /TemplateGroup/Template/C/Blog <— How can I get the title to say “Blog”?

I’m sure I have to use a conditional in my latest_news/index page which will call the header (and LG Meta) with a parameter. I’m just trying to figure out how feed LG Better Meta a category title.

Sorry if I’m missing something really basic here.

Any suggestions?

Thanks in advance.

       
Danny T.'s avatar
Danny T.
426 posts
17 years ago
Danny T.'s avatar Danny T.

Hello,

I’m not quite sure what you’re trying to get it. Your post is VERY confusing, but I’m sure I’d be able to help you if you clarify it a bit more. Did you get this resolved yet? If not, I’d be glad to help.

       
vorari's avatar
vorari
40 posts
17 years ago
vorari's avatar vorari

Hi,

LG Better Meta works brilliantly when passed a url_title, but I was struggling to figure out how to get category titles showing up in my blog.

Eg: <title>{LG Code}</title> is the default and you usually call the module with a specific url_title. Assuming this code is within a header embed, you would usually link segment_2 to the url_title. This method was failing miserably with categories.

In the end I ended up having a more complex conditional statement starting with a check as to whether a category was requested or not. That code was {if not_category_request}

       
Danny T.'s avatar
Danny T.
426 posts
17 years ago
Danny T.'s avatar Danny T.

Hello,

Rather than using url_title, you can pass things through as “title” and it will append it to the original title with the separator you had specified in your LG Better Meta settings. Does this help in anyway?

~

Another thing.. Keep in mind, I’m not 100% sure if I’m correct on this or not, but if you use segments to just pull data out to be displayed and used for LG Better Meta, it will not apply formatting to anything except for weblog titles.

So if you have http://www.example.com/index.php/category_name, it would output it as category_name instead of Category Name, which has formatting applied. I’m not sure if you’d like to do this, but try to pass it the {category_name} variable inside a {category_heading} tag pair.

I know it adds a lot of code, but I’m tired and can’t think of any other way to do this. I also might be wrong about this too by the way. I can’t access EE right now to verify it, but I am pretty sure about this.. Kind of. :roll:

       
vorari's avatar
vorari
40 posts
17 years ago
vorari's avatar vorari

Thanks much for the tip. On the blog portion of the site I do call it using Title. Took a while to debug, partly because EE is so flexible.

Cheers,

Nagib

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

There is are new examples of how to use categories with LG Better Meta available on the docs pages.

The examples do require version 1.6, a new release that fixes many bugs in the free 1.4 version.

Cheers Leevi

       
mrpiano's avatar
mrpiano
85 posts
about 17 years ago
mrpiano's avatar mrpiano

Hey all,

Just bought commercial version of Better Meta…and I’m hopeful 😊

Ok, so in my header template:

{exp:lg_better_meta
    <title>{title}</title>
    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}"
  }

On my index template, in an attempt to pull all this stuff in…

{embed="main/header" page_title="Mobile On-Site Cooking Oil Recovery & Recycling by AmeriGrease | Home"}

I know I’m hard coding stuff that I ultimately want Better Meta to populate on it’s own…

Now, on the “Better Meta” tab used within each post, everything in there seems to be ignored.

In the “utilities” area where I can set the Global Settings, well, it seems everything is being populated from there.

What I want, of course, is that each post gets the meta data that I input at the post-level carried over into that particular page.

Can anyone help me out? Website, by the way, is here.

Thanks!

Gino

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
about 17 years ago
Leevi Graham's avatar Leevi Graham

Your embed variables need to match up. At the moment you are passing through “page_title” in your include but passing “title” to LG Better Meta.

That should sort you out.

       
mrpiano's avatar
mrpiano
85 posts
about 17 years ago
mrpiano's avatar mrpiano

Ok, so to pass the page_title into my include dynamically, instead of the hard-coded value above, what would I need to put in my header template with all the lg code and how would I change my include file to achieve this?

Thanks, Leevi. I also mentioned via another thread that when I use your extension I can no longer see my admin main dashboard, which is probably a bigger problem 😊

Any help you can offer in both arenas will sort me out nicely…

Thanks,

Gino

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
about 17 years ago
Leevi Graham's avatar Leevi Graham
Ok, so to pass the page_title into my include dynamically, instead of the hard-coded value above, what would I need to put in my header template with all the lg code and how would I change my include file to achieve this? Thanks, Leevi. I also mentioned via another thread that when I use your extension I can no longer see my admin main dashboard, which is probably a bigger problem 😊 Any help you can offer in both arenas will sort me out nicely… Thanks, Gino

Hey Gino,

You need to pass through either the entry_id or url_title to get entry specific meta. Check out the LG Better Meta Usage Docs

Regrading the blank cp… See if you can access the extension settings page and turn off the auto update checking.

Cheers Leevi

       
mrpiano's avatar
mrpiano
85 posts
about 17 years ago
mrpiano's avatar mrpiano

Hi Leevi,

I turned off the auto-update feature and that solved that particular problem. Regarding the usage, I will continue to look at the docs and see what I can come up with. If I have further questions, I’ll be sure to ask!

Thanks!

Gino

       
mrpiano's avatar
mrpiano
85 posts
about 17 years ago
mrpiano's avatar mrpiano

Ok, Leevi, so getting there I think…

Here’s an example of what I have in my page template:

{embed="main/header" url_title="{segment_4}"}

This is working well, but there is a conditional that I’m having trouble figuring out, and it’s basically anything that includes a segment_2 or a segment_3 as well.

Here is a good example of the segment_4 code working as planned.

But here is an example of a segment_2, which does not work of course because I’m only pulling in the segment_4 url_titles.

What would be the proper way to write the conditional that will give me the url_title no matter which segment I’m pulling?

Almost there, I think, and thanks again.

Gino

       
illustrationdan's avatar
illustrationdan
26 posts
16 years ago
illustrationdan's avatar illustrationdan

Im having some problems getting the first post or parent page to display its meta information, so far i have this in my embedded html header

{exp:lg_better_meta_pi:template
    entry_id="{embed:entry_id}"
    weblog_id="{embed:weblog_id}"
    url_title="{segment_2}"
    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}"
  }

so im able to get the meta information to show for the segment_2 pages, how do i get it to show for the parent page as well.

mysite.com/index.php/metanotshowing/metaisshowing/howdoyougetthismetashowing

Can i place a conditional in the url_title=”{segment_2}” segment? like segment_1 ,2 ,3 etc. if so how would that be written? sorry im a noob conditional statment guy lol

hopefully this makes sense and im not requesting too much 😊

       
illustrationdan's avatar
illustrationdan
26 posts
16 years ago
illustrationdan's avatar illustrationdan

Found a solution for this, im not really a conditional statement guy but this worked for me.

In your template: using this as your header embed {embed="embeds/html_header"}

header embed: The only change to the lg_better_meta_pi:template was url_title=”{embed:url_title}” but make sure you keep the other items in there as well, i just shortened so yo uknow what i changed.

{if segment_2!=url_title}
{exp:lg_better_meta_pi:template
    url_title="{segment_2}"
  }
{if:elseif segment_2== url_title}
{exp:lg_better_meta_pi:template
     url_title="{segment_1}"
}

{/if}
       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

You should be including lg_better_meta in a head include. Then you can just pass through the segment you need on the individual pages.

See: [ulr=http://leevigraham.com/cms-customisation/expressionengine/lg-better-meta/#embedded-templates]http://leevigraham.com/cms-customisation/expressionengine/lg-better-meta/#embedded-templates[/url]

       

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.