Related Entries Showing Only Current Entry
Posted: 30 August 2007 08:52 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  219
Joined  09-30-2004

I’m trying to get the related entries tag to work here, as shown below the post here:

http://www.golfblogger.com/index.php/golf/comments/callaway_microfiber_windshirt/

But it only shows the current entry.

I’d like it to show four different entries related to the current topic.

Here’s the code I’m using:

<p class="related-entries">Related Entries<br />
{exp:weblog:related_entries weblog="{master_weblog_name}" limit="4" backspace="3" orderby="random" dynamic="off"}
<a href="{title_permalink={template_group_name}/comments}"> {title} </a> |
{/exp:weblog:related_entries}
</p>
{/exp:weblog:entries}

Build:  20070726

Thanks for your help

Profile
 
 
Posted: 30 August 2007 09:55 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  25625
Joined  05-20-2002

LOL- my dad would love your site!

OK- let’s see- double check the docs on related entries- many of the parameters you’re trying to use don’t exist in the related entries tag pair.  Further, the tag goes INSIDE a weblog tag- like:

{exp:weblog:entries weblog="news" limit="15"}

<h3>{title}</h3>

{related_entries id="performers"}
<h2>{title}</h2>
{body}
{
/related_entries}

{
/exp:weblog:entries}

That said- I’m not sure you’re really wanting ‘related entries’- are you wanting to show other entries that are in the same category as the golf shirt?  If so, there’s a new syntax- you use the related categories parameter- like:

{exp:weblog:entries weblog="{master_weblog_name}" limit="4" backspace="3" orderby="random"}
<a href="{title_permalink={template_group_name}/comments}"> {title} </a> |
</
p>
{/exp:weblog:entries}

That would show 4 entries that are in the same category as the shirt.

Make sense?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 30 August 2007 12:16 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  219
Joined  09-30-2004

Ok, here’s my new code:

<p class="related-entries">Related Entries<br />
{exp:weblog:entries limit="4" weblog="{master_weblog_name}" backspace="3" orderby="random"}
<a href="{title_permalink={template_group_name}/comments}"> {title} </a> |
{/exp:weblog:entries}
</p>

It’s now showing only a single entry, of the same title as the original post.

Profile
 
 
Posted: 30 August 2007 12:32 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  25625
Joined  05-20-2002

Yes, that would probably be because I SAID to add the related_categories_mode parameter and then for some reason did NOT add it to my example code.  Clearly, I need more caffeine.

Try it like:

<p class="related-entries">Related Entries<br />
{exp:weblog:entries limit="4" weblog="{master_weblog_name}" related_categories_mode="on" backspace="3" orderby="random"}
<a href="{title_permalink={template_group_name}/comments}"> {title} </a> |
{/exp:weblog:entries}
</p>

Sorry about the goof, jretzer.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 31 August 2007 07:08 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  219
Joined  09-30-2004

Ok. Here’s what I have in there now

<p class="related-entries">Related Entries<br />
{exp:weblog:entries weblog="{master_weblog_name}" related_categories_mode="on" limit="4" backspace="3" orderby="random"}
<a href="{title_permalink={template_group_name}/comments}"> {title} </a> |
{/exp:weblog:entries}
</p>

Its still showing only the current post.

Profile
 
 
Posted: 31 August 2007 11:10 AM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40207
Joined  05-14-2004

Hi, jretzer - can we go back a moment to exactly what it is that you wanted to do? In plain English, no code.  Did you actually have related entries, or did you want to show all entries in the same category as the main entry on that page?  Or something else entirely?

 Signature 
Profile
MSG
 
 
Posted: 31 August 2007 04:20 PM   [ Ignore ]   [ # 6 ]  
Lab Assistant
RankRank
Total Posts:  219
Joined  09-30-2004

I’m trying to get it to show four other posts from the same category or categories, selected at random.

The code I started with I just took from another EE site I have where it works fine. But that install is older—I haven’t upgraded it in a while ... so perhaps that code doesn’t work any more.

Profile
 
 
Posted: 31 August 2007 07:17 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40207
Joined  05-14-2004

“That code”?  What code is it?  Related categories mode was handled differently in older versions of EE so it is quite possibly you’re using the older way.  But without seeing the code, I’m just guessing.

 Signature 
Profile
MSG
 
 
Posted: 31 August 2007 07:28 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
RankRank
Total Posts:  219
Joined  09-30-2004

The code I had in the first post is the code that is currently working on my other blog, and is the code that I copied into my new blog. On the other one, it works, giving me four random entries selected from the associated   categories. But it doesn’t work on GolfBlogger.

Profile
 
 
Posted: 31 August 2007 07:34 PM   [ Ignore ]   [ # 9 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40207
Joined  05-14-2004

Ah yes, sorry about that.  Yes, I think that is older code that was replaced with the use of the weblog entries tag with related_category_mode.  I say “I think” because it’s been well over a year since that change. What version is that site on?

You’ll need to use the correct code for the correct version.

 Signature 
Profile
MSG
 
 
Posted: 31 August 2007 09:48 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
RankRank
Total Posts:  219
Joined  09-30-2004

Right. So here’s my new code. And it doesn’t work. All I get is a single link to the current post.

<p class="related-entries">Related Entries<br />
{exp:weblog:entries weblog="{master_weblog_name}" related_categories_mode="on" limit="4" backspace="3" orderby="random"}
<a href="{title_permalink={template_group_name}/comments}"> {title} </a> |
{/exp:weblog:entries}
</p>
Profile
 
 
Posted: 02 September 2007 08:21 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  25625
Joined  05-20-2002

What build of EE are you running?  If you aren’t on the latest?  I’d suggest upgrading, as the code above should currently work.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 02 September 2007 07:41 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
RankRank
Total Posts:  219
Joined  09-30-2004

Here’s the build I’m running:

Build:  20070726

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120497 Total Logged-in Users: 43
Total Topics: 126567 Total Anonymous Users: 22
Total Replies: 665446 Total Guests: 321
Total Posts: 792013    
Members ( View Memberlist )