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

Last Segment for EE 2.0

Development and Programming

Bjørn Børresen's avatar
Bjørn Børresen
629 posts
16 years ago
Bjørn Børresen's avatar Bjørn Børresen

Last Segment extension + plugin for EE 2.0

This extension will add the following global variables:

* {last_segment} – last segment (will never be the pagination segment ie /P1)
* {last_segment_absolute} – absolute last segment (even pagination)
* {last_segment_id} – the id of the last segment (for example “3”)
* {last_segment_absolute_id} – the id of the absolute last segment

If you don’t want to add these global vars you can use the plugin instead:

{exp:last_segment} will return the last segment. {exp:last_segment ignore_pagination='no'} will be the same as {last_segment_absolute}

http://github.com/bjornbjorn/Last-Segment-extension—plugin

Download it here: http://github.com/bjornbjorn/Last-Segment-extension—plugin/zipball/master

// UPDATED description: 19/02/2010

       
daulex's avatar
daulex
152 posts
16 years ago
daulex's avatar daulex

Nice, just wish I could get it to work.

Doesn’t even appear in the extension or plugin lists.

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
16 years ago
Bjørn Børresen's avatar Bjørn Børresen

Yeah, it’s probably the name of the folder. Rename it to ‘last_segment’.

So, the extension file is:

<your-system-folder>/expressionengine/third_party/last_segment/ext.last_segment.php

       
daulex's avatar
daulex
152 posts
16 years ago
daulex's avatar daulex

SCHWEET, done that, it works well enough.

_absolute returns the same thing as the normal tag, it ignores the /P1/ bit, which is great.

Thank you. This would be even more epic, if you could echo a “last_segment_id”, as in the sequential number of the segment.

so: site.com/se/gm/en/ts/

{last_segment} says: ts {last_segment_id) says: 4

http://ee.bybjorn.com/last_segment this is where the documentation link goes to (404).

Make a sexeh homepage for this beautiful plugin!

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
16 years ago
Bjørn Børresen's avatar Bjørn Børresen

Thanks for the feature request .. shouldn’t be hard adding that bit of info.

Make a sexeh homepage for this beautiful plugin!

haha .. yeah it’s on my todo list 😉 .. Added a redirect to this thread for now 😊

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
16 years ago
Bjørn Børresen's avatar Bjørn Børresen

daulex: I just added {last_segment_id} and {last_segment_absolute_id} .. download the latest release from github.

       
daulex's avatar
daulex
152 posts
16 years ago
daulex's avatar daulex

Danke mate. Seriously, that’s awesome. Thank you very much.

Added you on twitter 😊

       

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.