Related Entries Showing Only Current Entry
Posted: 30 August 2007 07:52 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  201
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 08:55 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23538
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 11:16 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  201
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 11:32 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23538
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 06:08 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  201
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 10:10 AM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32911
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 03:20 PM   [ Ignore ]   [ # 6 ]  
Lab Assistant
RankRank
Total Posts:  201
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 06:17 PM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32911
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 06:28 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
RankRank
Total Posts:  201
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 06:34 PM   [ Ignore ]   [ # 9 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32911
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 08:48 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
RankRank
Total Posts:  201
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 07:21 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23538
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 06:41 PM   [ Ignore ]   [ # 12 ]  
Lab Assistant
RankRank
Total Posts:  201
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 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65027 Total Logged-in Users: 43
Total Topics: 82116 Total Anonymous Users: 15
Total Replies: 441312 Total Guests: 187
Total Posts: 523428    
Members ( View Memberlist )