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.

Setting Up Basic Blog URL Structure /year/month/day/title

April 05, 2012 4:32pm

Subscribe [4]
  • #1 / Apr 05, 2012 4:32pm

    chadwithuhc

    1 posts

    Hello,

    I’ve tried searching and can’t find a thing in here. Can someone point em in the right direction?

    What’s the best way to go about creating a basic blog or press release style URL structure such as:

    /blog/{year}/{month}/{day}/{title}

    I don’t really understand how to break out of the normal structure without creating a module for it, which I think is overkill in this scenario.

    Anyone have basic suggestions or tips on this? I think this should definitely be covered in the FAQ section.

    Thanks,
    Chad.

  • #2 / Apr 06, 2012 9:19am

    Firebrand Media

    64 posts

    I would be interested in this as well. I have a blog that I’d like to move from MovableType but don’t want to have to rewrite all of the URLs.

  • #3 / Apr 06, 2012 10:37am

    Emily Heath

    197 posts

    I’ve been meaning to write a blog post about this but it hasn’t happened yet! I’m doing this by writing URLs like this:

    /content/{entry_date format="%Y/%m"}/{url_title}/

    N.B. Only after doing that did I realise you could just put “/content/{entry_date format="%Y/%m"}/” into the Comment URL path in the Channel preferences, then you can just refer to the {comment_url_title_auto_path} as usual and have the date coming into that. OR I did it that way at first and it didn’t always work - I’m afraid I can’t remember now so you’ll need to try it out yourselves! (Do post what you find up here though for others.)

    You’ll need to set up your single page template entries with these parameters, so that it knows where to find the url_title

    url_title="{segment_4}"
    dynamic="no"

    There will probably be other things you need to do for your listings pages and archives and so on but the site I’ve used it on doesn’t have those.  I hope this will be enough for you to figure out the rest.

    You can see it working here if you’re interested (click on any of the stories on the homepage) http://www.freewordonline.com/

  • #4 / Apr 06, 2012 10:44am

    Emily Heath

    197 posts

    N.B. my initial post had some of the code stripped out, I’ve edited it now to fix it so please check this thread again.

  • #5 / Apr 06, 2012 12:52pm

    Shane Eckert

    7174 posts

    Hey chadwithuhc,

    What do you think of Emily’s example?

    There is also an older wiki entry, but the idea is still valid, here.

    I can also move this over to the Community Help Forum to see if anyone there has some more ideas.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases