It looks to me like you are trying to simulate behavior already provided by the related_categories_mode parameter:
{exp:weblog:entries weblog="foods"}
...whatever content you want in here...
{/exp:weblog:entries}
<DIV class="related">
<UL>
{exp:weblog:entries weblog="foods" related_categories_mode="on"}
<LI><a href="http://{comment_url_title_auto_path}" title="{title}">{title}</a></LI>
{/exp:weblog:entries}
</UL>
</DIV>
Are you doing something different than what that parameter can offer?
I think you’ll need an embed for what you want to do. Something like this:
group/template_1
{exp:reeposition}
{exp:weblog:entries weblog="foods"}
{reeposition:item id="cats"}{categories backspace="1"}{category_id}&{/categories}{/reeposition:item}
{reeposition:item id="eid"}{entry_id}{/reeposition:item}
{/exp:weblog:entries}
{embed="group/template_2" cats="{reeposition:put_item id="cats"}" eid="{reeposition:put_item id="eid"}"}
{/exp:reeposition}
group/template_2
<DIV class="related">
<UL>
{exp:weblog:entries weblog="foods" category="{embed:cats}" entry_id="not {embed:eid}"}
<LI><a href="http://{comment_url_title_auto_path}" title="{title}">{title}</a></LI>
{/exp:weblog:entries}
</UL>
</DIV>
How does that look?
Incidentally, you may want to post a feature request to have the related_categories_mode be able to handle both OR and AND situations. Maybe something like
{exp:weblog:entries weblog="blog" related_categories_mode="or"}
versus
{exp:weblog:entries weblog="blog" related_categories_mode="and"}
Hello, I use the Solspace tag module. When entry_id is not part of the url, the code below dont work. Entry_id is in the weblog entries loop, and I need it outside the loop.
{exp:reeposition}
{exp:weblog:entries weblog="web" orderby="edit_date" sort="desc" limit="1" category="4"}
{reeposition:item}{entry_id}{/reeposition:item}
<h1>title</h1>
{text}
<div class="tagsarticle">
{exp:tag:tags entry_id="{entry_id}" backspace="1" type="weblog" orderby="clicks" sort="desc" limit="10"}
<a href="http://{path=site/tags/tag}{websafe_tag}" title="{tag_name}">{tag}</a> |
{/exp:tag:tags}
</div>
{/exp:weblog:entries}
<div class="tagsrelated">
<h3>Tag related...</h3>
<ul>
{exp:tag:related_entries limit="10" entry_id="{reeposition:put_item}" }
<li><a href="http://{url_title_path=site/articles/}">{title}</a></li>
{/exp:tag:related_entries}
</ul>
</div>
{/exp:reeposition}
The code don’t work : if I use reeposition put_item outside the tag related_entries, it works fine.But in the tag, it seems put_item is not parsed at the good time … How proceed ?
Hi Mr. Wilson,
I just love this plugin! I’ve used it very successfully on a few projects but there is one little thing that bugs me.
When wrapping the weblog tag with this plugin, the weblog tag’s 404 redirect stops working. An example:
{exp:reeposition}
{embed="includes/_html_header_inc" title="{reeposition:put_item id="title"}"}
{exp:weblog:entries weblog="news" url_title="{segment_3}" require_entry="yes" limit="1"}
{if no_results}{redirect="404"}{/if}
</h2>{title}</h2>
{reeposition:item id="title"}{title}{/reeposition:item}
{/exp:weblog:entries}
{/exp:reeposition}
When I place the reeposition tags inside the weblog tag, the 404 redirect works fine. Unfortunately that won’t work for my current project.
I tried catching the 404 page in the plugin somehow but without success. Any ideas on how to work around this problem?
Cheers!
EDIT: changed the example.
Hey Mr. Wilson, a small feature request here 😊 I’d like to see this plugin be able to store the items in the $SESS->cache array so that multiple calls to the plugin can be made on a template, all having/or adding to the pool of available items.
Maybe you could add an ID to the tag so you could have multiple reeposition tags
Mr. Wilson,
I’m having a bit of a weird issue that’s being causes by Reeposition. It’s outlined in this thread:// http://ellislab.com/forums/viewthread/70618/
Any ideas?
EDIT: Sorry, I just noticed that Cocoaholic is having the exact same issue that I’m having with the 404 redirect if no results.
I’ll try it by putting the reeposition code inside of the weblog entry tag and see if that changes the behavior or if it will even work for what I need.
Thanks
Hi deronsizemore,
Please give Reeposition 1.3 a shot. I actually worked on this back in December, but for some reason I didn’t update the file on the server. Since it’s been a while, I don’t remember the reasons behind the 404 problem, and I don’t have time to refresh my memory right now. But give this a shot:
Instead of
{if no_results}{redirect="404"}{/if}
use
{if no_results}{reeposition:redirect="404"}{/if}
Please let me know how that works out for you.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.