Skip to content
Daniel Poulin edited this page Jul 2, 2012 · 1 revision

Path Helpers

Url_title to Entry_id

Simply outputs the entry_id associated with a url_title.

Parameters

  • url_title: The url_title you wish to convert.

Return Value

The entry_id of that corresponds to the url_title. Returns an empty string if no entry is found.

Usage Example

{exp:surgeree:url_title_2_entry_id url_title="{segment_3}"}

Proper Title

A method which attempts to turn a url_title back into the entry title from which it was converted. It is not meant as a robust solution, but is helpful in cases where there is no entry corresponding to a template, but for which you wish to output an appropriate title for based on the url, perhaps in a breadcrumb navigation.

Parameters

  • url_title: The url_title value to convert.

Return Value

The url_title with all words uppercased on the first letter, and with dashes and underscores replaced with spaces.

Usage Example

The following snippet

{exp:surgeree:proper_title url_title="goku_returns_from_the_dead"}

will output:

Goku Returns From The Dead

All Segments

A simple wrapper around Codeigniter's ->uri->uri_string method.

Return Value

The entire uri string (e.g. all segments).

Usage Example

On a page http://some.ee.site/something/category/blue/4325, the following snippet

{exp:surgeree:all_segments}

will produce:

something/category/blue/4325

Total Segments

A simple wrapper around Codeigniter's ->uri->total_segments method.

Return Value

The number of segments in the url.

Usage

{exp:surgeree:total_segments}

Current URL

A simple wrapper around Codeigniter's current_url method from the url helper.

Return Value

The entire url string.

Usage Example

On a page http://www.somewhere.dom/something, the following snippet

{exp:surgeree:current_url}

will output:

http://www.somewhere.dom/something