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.

URL customization that include Category HELP!!!

May 13, 2009 1:33am

Subscribe [1]
  • #1 / May 13, 2009 1:33am

    bambam

    10 posts

    hi,

    i’ve spent more than a day on this little thing, i look like Einstein but without the brains and much fewer hair than when i started!!

    so what i’m doing:
    any blog post (weblog post) can be customized with template reference correct?
    so when i use

    {title_permalink="my_weblog_template/template"}

    would produce a consistent url using that particular template. that’s all fine so far ...

    MY PROBLEM
    i want to customize this further so that the post permalink uses different template based on different categories

    for example i have 3 categories for a given weblog, and i have multiple weblogs (channels)
    i want to get: (automatically)
    http://domain.com/weblog1/category1/title_of_the_post
    http://domain.com/weblog1/category2/title_of_the_post
    http://domain.com/weblog1/category3/title_of_the_post

    this is what i’m using now but i can’t take it further, help please!!!

    {exp:weblog:entries orderby="date" weblog="story|blog" limit="7" category="4|5|6|7|8|9|10"}
    <a href="http://{if">{title}</a>
    {/exp:weblog:entries}


    what am i suppose to do to make this work, i’ve tried and tried and nothing works!!! my latest invention is this: IT DOES NOT WORK but in theory it’s exactly i what i need

    {exp:weblog:entries orderby="date" weblog="story|blog" limit="7" category="4|5|6|7|8|9|10"}
    <a href="http://{if">{title}</a>
    {/exp:weblog:entries}
  • #2 / May 13, 2009 7:23am

    e-man

    1816 posts

    Have a look at Low’s Seg2Cat extension:
    http://loweblog.com/freelance/article/ee-low-seg2cat-extension/

    I think it’ll go a long way to help with what you’re trying to do.

  • #3 / May 13, 2009 11:28am

    bambam

    10 posts

    thanks for the recomendation, this is useful but unfortunately not for my current problem

    from Low Seg2Cat website

    Low Seg2Cat loops through the segments of the current URI, matches them against existing categories, and registers the matching categories as global variables, which you can use in your templates.

    this plugin work when the url is set. but what if the url is the root index. in fact what i’m trying to do is to setup the URL’s to categories and post from index (http://domain.com/)

  • #4 / May 13, 2009 12:58pm

    e-man

    1816 posts

    I see what you mean now, but I think you are confusing weblogs with template groups here.
    Also this sort of defeats the idea of a permalink which is 1 permanent url for any given article.
    Why exactly do you need this kind of extreme customization?

  • #5 / May 13, 2009 1:18pm

    bambam

    10 posts

    to be honest i didn’t want it to be this complex, but i’ve got menus that highlight based on the category, the only way i could highlight or add class to a particular menu was through URL segment ... see code below for the menu:

    <ul class="topic_nav">
    <li class="first"></li>
                        
    {exp:weblog:categories weblog="story" show_empty="no"}
    
    <li><a href="http://{path=" title="my {category_name} pages" class="selected">{category_name}</a></li>
                        
    {/exp:weblog:categories}
                                    
    </ul>

    if there is a better of doing the above then i won’t need to go this complicated to make everything else work

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

ExpressionEngine News!

#eecms, #events, #releases