Related entries … Help. 
Posted: 07 March 2008 02:46 PM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  49
Joined  2007-04-30

Trying to display a list of entries (from a specific weblog) on my permalink page, and have tried just about everything without success.

Tried to figure out how it’s supposed to work but reading the docs only made things worse.  :0

First off, where should this tag go?  In the docs it says that it can use the {entry_id} parameter, so I assumed that it would go between the main exp:weblog tags.  Further down in the docs it warns about placing this tag inside the weblog tag…

Then ... the sample code completely confuses things by adding more variable pairs which aren’t listed in the docs above:

<div class="entry">
<
h3>Entries related by tag</h3>
{exp:tag:related_entries dynamic="off" limit="2" paginate="bottom"}
<h4><a href="{url_title_path=’tags/entry’}">{title}</a></h4>
<
div class="related">
<
h6>Related Entries</h6>
{related_entries id="related_field_name"}{title} - {summary}|{/related_entries}
</div>
<
div class="tags">
{exp:tag:tags entry_id="{entry_id}"}<a href="{path='tags/tag'}{websafe_tag}">{tag_name}</a> {/exp:tag:tags}
</div>
<
hr />
{paginate}{pagination_links}{/paginate}
{
/exp:tag:related_entries}
</div>

Above, what is the ‘related_entries’ tag there for?? Is this required or is it just an example of using regular EE tag pairs?  There is no ‘related_field_name’ as I’m not comparing custom EE fields, I’m trying to compare tags from the tags module. Just don’t get what’s supposed to happen here....

What I’m trying to do, is on my details (’permalink’) page, at the bottom I would like to have an area which has “Related Entries Using the (the tag name here) tag”, followed by a list of titles and summaries for all entries using the same tag as this page, and limited to a specific weblog.

What code should I use, and where do I place the tag:related_entries tag?

Tx.

Profile
 
 
Posted: 09 March 2008 08:58 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  702
Joined  2004-03-30

ira42,

I too am a bit confused. Let me say a few things and ask a question or two then we can move forward.

First, you’re talking about a detail page, meaning you’re seeing a single blog entry in full detail. In the url you have the template stuff and then the url_title most likely. The exp:tag:related_entries function will show other blog entries related to the main blog entry by tags that they share. Since your blog entry can have multiple tags associated with it, it sounds odd to say that you have a list of entries related to the primary one by (the tag name here) tag. It could be related by any number of shared tags.

This is a good start. Does any of this part makes sense?

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 10 March 2008 06:01 AM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  49
Joined  2007-04-30

Yes, so far that sounds correct.  Let me clarify how we’re using the tags.

Let’s say we have 2 weblogs:

- “Products” (each of the 20 or so posts in this weblog are individual products that the company sells).
- “Press Releases” (a few hundred press releases).

We only use product names for our tags, and when creating a press release entry (or product entry), we tag them using the appropriate product names using the Tags tab. 

On the tags archive list page, people can sort the releases by tag (by product name). When they get to the press releases details page, I would like to display a list of PRODUCT entries which share the tags of the current entry (it can loop through all of the shared tags if necessary).

I see what you’re saying about possibly having multiple tags for this details page, but the header at the bottom could probably just read, “Related Product Entries:”.  It doesn’t have to include the tag name(s) necessarily (unless it could work like the Category Archive EE tag).

Tx!

Profile
 
 
Posted: 10 March 2008 06:55 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  2261
Joined  2006-10-18

ira42,

I’ve updated the Docs… I replaced that yucky example with something cleaner rasberry LOL

Tag Related Entries Documentation

{exp:tag:related_entries weblog="products" orderby="date" sort="desc" dynamic="off" limit="5" paginate="bottom"}
<p><a href="{permalink="template_group/template"}">{title}</a></p>
<
p>{summary}</p>
<
p>{custom_field}</p>
<
br /><br />
<
p>{paginate}{pagination_links}{/paginate}</p>
{/exp:tag:related_entries}

 Signature 
Profile
 
 
Posted: 10 March 2008 01:07 PM   [ Ignore ]   [ # 4 ]
Jr. Member
RankRank
Total Posts:  49
Joined  2007-04-30

Hey again,

Thanks for your help, and yes that example is much more clear!

I couldn’t quite get it to work using similar code, as with ‘dynamic’ set to ‘off’ and the code outside of my main weblog tag, it wouldn’t return any results.  However in the end, I needed to embed the ‘related tags’ tag anyhow (as I’m re-using it for multiple details pages), and when I did, it returned all of the results as expected.

Cheers!

Profile
 
 
Posted: 11 March 2008 07:28 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  702
Joined  2004-03-30

Ira,

Sorry about that embed thing. I like to avoid naming all of my variables differently from EE variables. But when I do that, my variables get parsed along with EE. So embedding is the way to do it. Though it is often confusing.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 10 May 2008 06:01 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  3
Joined  2008-04-23

Thanks guys!
But I’m sure that some other folks need a little extra.
The following would’ve saved me a lot of time:

This is my ‘related_artcls’ template:

<ul>
{exp:tag:related_entries weblog="noticias"  orderby="click" sort="desc" rank_limit="5" status="publicar"}
<li><a class="entry-title"; href="{permalink="noticias/index"}">{title}</a></li>
{/exp:tag:related_entries}
</ul>

And this is the embedding in the mother (index) template:

{embed="noticias/related_artcls"}
{assign_variable
:my_weblog="noticias"}
{assign_variable
:my_template_group="noticias"}

I’m sure there are a few idiots like me around there…
Hope this helps them.

Profile