EE 1
EE 2
Jb Last Segment
Developer
3rd Party (Free)
Download v1.0.3Compatibility
- LG Addon Updater
- Multi Site Manager
- Stand Alone Entry Form
Requirements
- jQuery for the Control Panel
Tags
We all love clean urls and most of the time the most important part of the url is the last segment. For example a url of http://foo/bar/10/01/url_title has lots of data in it, but to get the actual entry url, we care most about the url_title part. It can be a pain to keep track of where in the segment_1, segment_2, segment_3.., that will be, especially if there are mulitple paths to the same resource.
Rather than tracking exactly how the url segments are built up throughout the site it would be nice to be able to consistently get the last part of the url. The last segment. And that’s exactly what this extension does. So now it doesn’t matter if the url is http://foo/bar/news/10/01/url_title or http://foo/bar/url_title – the variable * returns *url_title for all cases.
Installation
- Download and unpack JB Last Segment (also on github)
- Copy extensions/ext.jb_last_segment.php to your /system/extensions directory
- Activate the extension via System Administration > Utilities > Extensions Manager
Usage
There’s not much to do once this extension has been installed, it adds a new variable to your global variables, and you can use that variable in your templates whereever you’d like.
If previously you had :
{ exp:weblog:entries limit='1' dynamic='off' url_title='{segment_3}' }
you can now replace that with
{ exp:weblog:entries limit='1' dynamic='off' url_title='{last_segment}' }
given that the url_title is in the last segment of the url.
Support
Support and feature requests are handled via github.
Download Jb Last Segment
| EE Version | Downloads | Add-On Version | Release Date |
|---|---|---|---|
| 1.x | Download | 1.0.3 | 2009-11-03 07:00 PM |
Jb Last Segment Links
This entry was last updated August 15, 2011, 8:41 am.
Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. Devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!
There are no reviews for this add-on yet.
What are you waiting for? Rate it and review it!