How to get articles using tag
Posted: 07 January 2008 01:46 AM   [ Ignore ]
Newbie
Rank
Total Posts:  4
Joined  2007-11-12

Hi,

I have solspace tag module install & while posting entry i m adding tags to each & every entry.

Now my question is how can i search an article using those tag field dynamically like i have an template name latest news where i m getting the latest one article from news category. and i have another template named drivers where i want to show the article related to the tags associated with the news i m getting in latest news module.

Any help would be highly appreciated.

Thanks & Regards

- Vikas

Profile
 
 
Posted: 07 January 2008 07:31 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

If I understand you correctly, you’d like to show “related” entries to the current entry being shown?

If so, have a look at this page: Tag 2.0 Related Entries Documentation

If you have any further questions, please let me know smile

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 08 January 2008 12:32 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  4
Joined  2007-11-12

I think i have not explain it properly what i want .

Here i m trying to explain it again

Basically what i m trying to do is i have two weblogs one i m using for news & the other one i m using for drivers & now wat i want is i want to display the drivers related to the tags i m adding in the news from drivers weblog.

basically something like using the news tag to search in drivers weblog & display the result.

{exp:weblog:entries weblog="f1news" limit="1"}
{title}
{article_author}
{article_text}
{entry_date format
="%M %d, %Y"}<br />

{exp:tag:tags entry_id="{entry_id}"}
<a href="{path=tags/tag}{websafe_tag}" title="{tag_name}">{tag_name}</a>
{/exp:tag:tags}<br /><br />

{exp:tag:related_entries weblog="F1Teams" tag="{tag_name}"}
<h3>Related Entries</h3>
<
ul>
<
li>{entry_date format="%F %j, %Y"<a href="{path="{weblog_short_name}/item"}{url_title}/">{title}</a></li>
</
ul>
{/exp:tag:related_entries}

{
/exp:weblog:entries} 

I hpoe this will help

- Vikas

Profile
 
 
Posted: 08 January 2008 06:52 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

Is each “driver” a weblog entry? smile
And from what I understand, you only want a list of “related” Drivers (entries?) to show up beside or under the News Article?

Did I get it right? raspberry

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 09 January 2008 01:27 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  4
Joined  2007-11-12

Yes

- Vikas

Profile
 
 
Posted: 09 January 2008 07:25 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

Then Related Entries is what you’ll need, but change your code to look like this:

{exp:weblog:entries weblog="f1news" limit="1"}
{title}
{article_author}
{article_text}
{entry_date format
="%M %d, %Y"}<br />

{exp:tag:tags entry_id="{entry_id}"}
<a href="{path=tags/tag}{websafe_tag}" title="{tag_name}">{tag_name}</a>
{/exp:tag:tags}<br /><br />

{/exp:weblog:entries}

{exp
:tag:related_entries weblog="F1Teams" entry_id="{entry_id}" tag="{tag_name}"}
<h3>Related Entries</h3>
<
ul>
<
li>{entry_date format="%F %j, %Y"<a href="{path="{weblog_short_name}/item"}{url_title}/">{title}</a></li>
</
ul>
{/exp:tag:related_entries} 

 Signature 

Check out the new Solspace Blog!

Profile