Clean URLs
  • Is there a way to grab a variable from the url without using permalinks?

    I know I could do

    But is there a way to use cleaner URLs for the three main landing pages:

    It would pull from the Exhibitions structure.

    I cannot use permalinks because I am using them for when you are at a single Exhibition:

  • 6 Answers sorted by
  • There's more magic to permalinks than you know about. :)

    Let's say you have an Exhibition called Worlds Fair, with Permalink:

    When someone hits that URL, it will render whatever HTML page you've defined as the permalink HTML page for exhibitions. But if you want to show, say, reviews of that exhibition, you can use this URL:

    This will render reviews.html (or .php, etc.) but in the context of the World's Fair exhibition. Pretty cool.

    To get to your original question, yes, you can pull out the "extra path" component of URLs such as these:

    It will be stored in $path. So you can do something like:

    <v:if path="$path='/current'"> ... </v:if>

    Let me know if that helps.

  • This is so cool! You should put it in the documentation!

    Is there a way for you not to have to put the file extension of the new page? I had to use

    to get it to work, would be great if you only had to put

  • I think I am trying to do something similar, but I'm hitting a road block.

    I have a collection called "Seasons", which contains a sub-collection called "Images".

    I am rendering each Season using runway.html.

    On the Season page, I show all the Images from the sub-collection, and I link each Image to its own page.

    Ideally I want the url's to look like this (where image1 is generated by the title I assign in the backend):

    ...or look like this (if we had to use something like look.html to render the image page):

    Any ideas on how to build this sort of url hierarchy?


  • @Scott

    That's different, I think a permalink page can only deal with 1 context at a time. You might have to relegate that second part to the hash

    or hashbang!/look/image1

  • Thanks Mike. That probably would have worked too.

    I ended up using the regular permalink structure. The client manually enters the Season and Look into a name field, which generates the type of url structure they were seeking.

    The urls ended up looking like this:

    Gets the job done.

  • hah, that looks even better!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion