access pages_url in Low Title 1.x?
Hey Low,
I was wondering: with the Low Title plugin for EE 1.x, is it possible to extract the title from an entry via its page_url in any way? I have a lot of "static entries" in my website, and it would make more sense to use Low Title.... otherwise I have to fall back on the exp:weblog:entries method to generate the title.
Cheers
R o B
Replies
Low 21 May 2010 07:08
Looks like I never put that update on my site! There's a version 1.2 that's available on GitHub that adds a pages_uri="" parameter.
But if I recall correctly, there was an update in EE 1.6.9 that changed the way the Pages module stores its URIs. Guess I'll need to update the plugin to accommodate that change if you're using that version.
oxygensmith 21 May 2010 07:49
Oh, sweet!
Anyway, you're right about the 1.69 change. It may not be too arduous to accommodate, though.
Here's a discussion that I took part in when the change in access to pages_uri affected LG .htaccess generator. I think it might "only" involve adding a site_id parameter (I looked in there the other day, and it's kind of a nasty data matrix— yuck), but see for yourself:
http://expressionengine.com/forums/vi...
oxygensmith 5 Sep 2011 19:33
Hey Low, I know that this parameter was added way back when, but I still can't get it to work properly. I'm in EE2 now, and I'm trying various combinations of segments, slashes and global variables in the pages_uri parameter, but can't get it to output the correct entry's title.
My page URL's are in the form /issues/healthcare/ and the page_uri records that as /issues/healthcare. Here's a sample of how I'm trying to write the tag/parameters out:
{exp:low_title:entry channel="static" pages_uri="/{segment_1}/{segment_2}/"}
Any help is appreciated, since there aren't examples in the docs for Low Title. Thanks!
oxygensmith 26 Sep 2011 19:14
Hey Low, any ideas about how I can access the pages URL with low_title? I still can't make it work even after futzing with it.
Low 26 Sep 2011 19:53
Hi! Can you try and download the version from GitHub and see if the problem persists with that version?
oxygensmith 26 Sep 2011 21:46
It appears to pull a title but this syntax:
{exp:low_title:entry channel="static" pages_uri="{segment_1}/{segment_2}"}
...always pulls the title of the most recent entry in the "static" channel, no matter what the values of segment_1 and segment_2 are.
Low 26 Sep 2011 22:01
Try this:
Note the slash at the beginning of the pages_uri attribute.
oxygensmith 26 Sep 2011 22:17
Hey Low, apologies, it's still not working, though I've pasted your code exactly.
I know that the title of this thread says "Low Title 1.x" but in the middle of this thread, I mention that I switched to EE2 — just want to make sure you caught that.
Thanks again
Low 26 Sep 2011 22:27
Yes, I'm aware it's for EE2.
What's the exact pages URI for the entry in question, i.e. what do you have entered in the publish form?
Secondly, you can turn on template debugging and look up the low_title:entry tag there, to see what the parameter says. It should be identical to said URI.
Finally, you can add the parameter show_error="yes" to display a debugging message. Does that come up with anything?
oxygensmith 27 Sep 2011 01:20
Ahhh, finally, that worked. It has to match the URI exactly, so whether it's video/index or video/ matters — of course.
Sorry for the time it took me to respond, I'm just looking for a way to parse "total number of segments" in the URL to put Low Title in some kind of conditional "case" structure (I sometimes have one, two, or three segments for pages in Pages):
{exp:switchee variable="{total_segments}" parse="inward"}
{case value="3"}
{exp:low_title:entry channel="static" pages_uri="/{segment_1}/{segment_2}/{segment_3}"}
{/case}
{case value="2"}
{exp:low_title:entry channel="static" pages_uri="/{segment_1}/{segment_2}"}
{/case}
{case value="1"}
{exp:low_title:entry channel="static" pages_uri="/{segment_1}"}
{/if}
{/exp:switchee}
I do this because I really want to have some pages with the URL my site.com/video, not mysite.com/video/index.
There's an add-on called "Current" that adds just such total segments variable, but it's giving me issues. I might try to use Freebie as a workaround in sections where there might be more than two segments... or just fall back on the exp:channel:entries.
Thanks for your help Low!