ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Noticing something about segment variables - looking for confirmation

September 02, 2008 1:07pm

Subscribe [1]
  • #1 / Sep 02, 2008 1:07pm

    SethG

    29 posts

    I have been wrapping my head around the use of variables and EE’s url structure for a project that I am working on.  I found a solution that seems to be working however I don’t understand why so am hoping someone at Ellis Labs or another dev might explain/confirm.

    Going to try this without a lot of background info as not sure it is needed.

    I needed to pass a segment url to a template however what to display a category of weblog data and allow for pagination and other features that rely on the url structure to function.  I found that if put the segment variable between the template segments and the category segments it seems to work automagically. 

    Wondering if there is something about EE’s path processing that I missed in the documentation that explains this.

    Here is the structure:

    <a href="http://something.com/&#91templategroup&#93/&#91template&#93/&#91segment_variable&#93/&#91categoryflag&#93/&#91cat_url_title&#93">http://something.com/[templategroup]/[template]/[segment_variable]/[categoryflag]/[cat_url_title&#93</a>;

    Again the above structure loads the right template, allows me to pull in {segment_3} and dynamically displays the the right category of data from the weblog in my weblog tag.  It also works with pagination which appends the “P1” ... to the end of the path.

    So again, my question is why does this work? 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases