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.

EE 1.6 new category feature?

June 22, 2007 5:11pm

Subscribe [3]
  • #1 / Jun 22, 2007 5:11pm

    Kevin Evans

    222 posts

    Hello,

    I am happy to hear that EE 1.6 is out…I haven’t installed it yet noticed int he changelog that it has added this:

    Added category=”” and category_group=”” parameters to the Weblog Module’s Next/Previous Entry Linking

    Does this allow staying within a category when using the next/previous Entry linking? It looks like it does.

    The reason I ask is that I think I’ve been looking for such a feature for the weblog gallery I have at http://www.kevinevans.net/art/detail/the_maelstrom_mephisto/

    If you look you will see as of now, when you click the next or previous link below the art, it will take you to the next oldest I’ve added rather than staying within the category its in, such as painting.

    Will this new feature fix it?

    Thanks!

    Kevin

  • #2 / Jun 22, 2007 5:14pm

    Ingmar

    29245 posts

    Does this allow staying within a category when using the next/previous Entry linking? It looks like it does.

    Yes, exactly.

    Will this new feature fix it?

    I don’t think this is working with the Gallery, we are talking about the Weblog module here.

  • #3 / Jun 22, 2007 6:35pm

    Kevin Evans

    222 posts

    Yes that’s what I mean, my gallery uses the weblog module.

    Kevin

  • #4 / Jun 22, 2007 7:37pm

    Kevin Evans

    222 posts

    Hello again,

    i went ahead and updated my site to EE 1.6…and I am trying to get the next/previous entry working on the weblog gallery but it does not seem to be working….

    All I want is to be able to stay with the category. So if you go to http://www.kevinevans.net/art/detail/the_savior/, that art is within the Still Category, the sibling of the Paintings category…when you click the link it should stay within the still life category but as you see its not being confined to that.

    Can this be done?

    Here’s the code I am using:

    {assign_variable:art_weblog_name="art_gallery"}
    {assign_variable:blog_weblog_name="blog"}
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>
    {exp:weblog:entries require_entry="yes" limit="1"}{title} |{/exp:weblog:entries} {exp:weblog:info weblog="{art_weblog_name}"}{blog_title}{/exp:weblog:info} | The Art of Kevin Allen Evans</title>
            <meta name="description" content="Art is the eternal dream of what lies beyond this life we know; it is beauty, darkness, ecstasy. . .the longing for the unknown. This website is my visual and written testament to that ideal. As Edgar Allan Poe once related, I put faith in dreams as in the only realities." />
    <meta name="keywords" content="art, kevin allen evans,symbolism, expressionism,horror, fantasy, abstract art, sublime art" />
    {embed="includes/head"}
    <body id="fine-art">
    <div id="wrapper">
    <!-- Begin wrapper main -->
    <div id="wrapper-main">
    <div id="wrapper-main-inner">
    <!-- Begin Main Column -->
    <div id="mainCol">
    <div id="header">
    {embed="includes/banner"}
    {embed="includes/main_nav"}
    </div>
    <div id="content">
    <h1 id="mainheading">{exp:weblog:info weblog="{art_weblog_name}"}{blog_title}{/exp:weblog:info}</h1>
    
    
    {exp:weblog:entries weblog="{art_weblog_name}" limit="1" rdf="off" paginate="bottom"}
    
    
    {categories}<a href="http://{path=art/category}">{category_name}</a> > {/categories} <strong>{title}</strong>
    
    
    {exp:weblog:next_entry weblog="{art_weblog_name}" category="10|11|12|13|14|15|16"}
    
    <a href="http://{path=">< Previous</a>
    
    {/exp:weblog:next_entry}
     
    {exp:weblog:prev_entry weblog="{art_weblog_name}" category="10|11|12|13|14|15|16"}
    
    <a href="http://{path=">Next ></a>
    
    {/exp:weblog:prev_entry}
    
    
    <div id="art-detail">
    <a href="http://{exp:extract_url}{art_image_url}{/exp:extract_url}" rel="lightbox" title="{title}">_/thumbnailer/phpThumb.php?src={exp:extract_url}{art_image_url}{/exp:extract_url}&wl=520&hp=520;</a>
    <h3>{title}</h3>
    <p>{if art_medium != ""} {art_medium}{/if}<br />
    {if dimensions != ""}{dimensions}{/if}<br />
    </div></p>
    
    
    
    <p>{exp:weblog:next_entry weblog="{art_weblog_name}" category="10|11|12|13|14|15|16"}</p>
    
    <p><a href="http://{path=">< Previous</a></p>
    
    <p>{/exp:weblog:next_entry}<br />
     <br />
    {exp:weblog:prev_entry weblog="{art_weblog_name}" category="10|11|12|13|14|15|16"}</p>
    
    <p><a href="http://{path=">Next ></a></p>
    
    <p>{/exp:weblog:prev_entry}</p>
    
    <p>{/exp:weblog:entries}</p>
    
    <p></div><br />
    </div><br />
    <!-- End Main Column --></p>
    
    <p><div id="sideCol"><br />
    <div id="sideCol-inner"></p>
    
    <p>{embed="includes/sidebar_nav"}</p>
    
    <p></div></div><br />
    <br class="clear" ></p>
    
    <p></div><br />
    </div><br />
    <!-- End wrapper main --></p>
    
    <p>  {embed="includes/footer"}</p>
    
    <p></body><br />
    </html>

  • #5 / Jun 22, 2007 9:03pm

    Derek Jones

    7561 posts

    The next/prev tags shouldn’t be nested within your weblog entries tag, so I would recommend moving them outside of there.  But your category parameter is probably the issue here:

    10|11|12|13|14|15|16

    That means that it will include any entries that are in those 7 categories.  Is that not what’s happening here?

  • #6 / Jun 23, 2007 2:54pm

    Kevin Evans

    222 posts

    Hello Derek,

    I want it where when you click through next/previous links, it keeps you within the category that piece is in, right now it goes through all of the pieces by date.

    If you go to http://www.kevinevans.net/ and click one of the categories on the top right it will take you to the category page/template. If you click one of the pieces, it will take you to the detail page, using the template called “detail” When you click the next button it should logically take you to the next in that category, what you saw on the category page before. But as you see, it takes you outside the category if you click through it enough.

    I originally went with the gallery module to control my art gallery but I did not like how you couldn’t assign a piece to more than one category, so I went with the weblog way the display. But one limitation I found later on is that you could stay within the category, in the Gallery module it could….which is why I was excited to hear about this new feature in EE 1.6

    So how do I confine it to its category? Do I need to make some modifications to the templates?

    Thanks!

    Kevin

  • #7 / Jun 23, 2007 5:26pm

    Derek Jones

    7561 posts

    Well with the tags nested as you have them, you might create your parameter as so, though you may wish to shuffle the next/prev tags off to an embedded template so you don’t run into any potential parsing issues, passing the category with an embed variable. Over-simplified:

    {exp:weblog:entries}
    {embed="site/.next_prev" cats="{categories backspace="1"}{category_id}|{/categories}"}
    {/exp:weblog:entries}

    Then in the .next_prev template:

    {exp:weblog:next_entry weblog="art_gallery" category="{embed:cats}"}
    <a href="http://{path=">< Previous</a>
    {/exp:weblog:next_entry}
  • #8 / Jun 23, 2007 8:02pm

    Kevin Evans

    222 posts

    thanks Derek!

    A couple of questions…so would I need something similar for the Next button also? I noticed you have backspace=“1”, is that for the previous link? Would I need some like forward=“1” for the next link?

    Also for the embed template you have, site/.next_prev, does the “period” before next have anything special to do with it? Or can I name the embed anything?

    Thanks again!

    Kevin

  • #9 / Jun 23, 2007 10:41pm

    Kevin Evans

    222 posts

    Another thing about this….will this work if a entry/piece has multiple categories? For instance some of my art is part of the main “Paintings” category and also part of a sub-category, such as the Self Portraits, a sub-category of paintings….what if I have a piece that is both part of the Landscape and Figurative sub-categories? Seems like this category feature might get confused….but maybe I am over analyzing it.

    thanks!

  • #10 / Jun 24, 2007 2:29am

    Derek Jones

    7561 posts

    Hey Kevin, the User Guide contains all the of the answers to the questions you are looking for.

    Weblog entries categories variable pair
    Hidden templates

    Post back if you need clarification on what’s going on after reading those pages of the docs.

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

ExpressionEngine News!

#eecms, #events, #releases