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.

Having a hard time understanding URL/URI

October 16, 2013 2:29am

Subscribe [2]
  • #1 / Oct 16, 2013 2:29am

    xheathen

    2 posts

    Hey everyone,

    We’re working on our first EE project and I’m getting a little confused on how we’re structuring data and how the URL/URI is supposed to work in an easy way for the client.

    So, basically we’ve got all the basic page put together - that seems straight forward - Pages Module and then you just set the URI of the page, and the boom its: http://yourdomain.com/about-us

    Where I’m getting hung up are on these specific channels that we have for specific content.  For example, I have 2 channels: News and Products.

    So for these I have specific templates that I set up.  For products, I have a template group of Products, and within that I have two templates.  The index (which displays the list of products) and the view (the individual product).  What I’m not getting is that when you click on the links for these, I get something like http://yourdomain/products/view/11 instead of something like http://yourdomain/products/my-product.

    If I change the URI of the product entry itself, it turns into a page and shows up in the pages.

    I’ve read some things about segments, but I’m not quite understanding how that might work in this situation.  Is there something to steer me in the right direction on what I’m looking for?

    Thanks!

  • #2 / Oct 18, 2013 11:54am

    travisb

    172 posts

    The reason the product example you gave is going to /products/view/11 instead of /products/view/my-product has to do with the way link itself is structured.

    For example, it seems like you have your “entry” template within the template group “products” set to display entries from your Products channel. In your links on the product listing page you could use something like:

    <a href="http://{url_title_path=products/entry}">My Product</a>

    to get a link with the url_title in the 3rd segment of the link, like:

    yourdomain.com/products/entry/my-product

    instead of using a link format that generates the entry id as the 3rd segment.

    I would suggest really getting into the docs to learn more about the url structure, available tags for path links, and how the channel:entries tag pair works dynamic=“yes” vs. dynamic=“no”.

    http://ellislab.com/expressionengine/user-guide/urls/url_structure.html
    http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#url-title-path
    http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#dynamic

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

ExpressionEngine News!

#eecms, #events, #releases