Tutorial request: how to get started
Posted: 25 April 2008 07:12 AM   [ Ignore ]
Newbie
Rank
Total Posts:  22
Joined  2008-04-17

I’ve purchased and loaded the Tag module and, given the specificity of the documentation, I have no idea how to do the most basic thing:

How do I display the tags for an entry in a template of that entry?

Can someone point me to a tutorial of how to use this tag?

Profile
 
 
Posted: 25 April 2008 08:12 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

seajay,

Thank you for purchasing the Tag Module!! smile

To show the Tags assigned to an entry, you’ll need to use the Tag:Tags loop… just use the following code:

{exp:tag:tags entry_id="{entry_id}" type="weblog" backspace="2" orderby="clicks" sort="desc" limit="10"}
<a href="{path='tags/tag'}{websafe_tag}" title="{tag_name}">{tag}</a>,
{/exp:tag:tags}

You would stuff that inside the Weblog:Entries loop if using on a page with multiple entries (archive list, etc), though I believe you can use it outside of the weblog:entries loop on a single entry page. Needless to say, a very basic example would look like this:

{exp:weblog:entries}
{title}
<br />
{body}<br />
Tags: {exp:tag:tags entry_id="{entry_id}" type="weblog" backspace="2" orderby="clicks" sort="desc" limit="10"}
<a href="{path='tags/tag'}{websafe_tag}" title="{tag_name}">{tag}</a>,
{/exp:tag:tags}<br /><br />
{/exp:weblog:entries}

I’m assuming you’ll want to have each Tag linked to a template that will show all entries with that Tag…

To do so, following the Tag:Entries documentation, your code for the Tag:Entries code might look something like this:

<h1>{exp:tag:tag_name}</h1>
  
{exp:tag:entries inclusive="yes" orderby="entry_date" sort="asc" limit="20" paginate="bottom"}
  
<p>{title}</p>
<
p>{body}</p>
  
<
br /><br />
  
{paginate}
<p>{pagination_links}</p>
{/paginate}
  
{
/exp:tag:entries}

{exp:tag:tag_name} automatically outputs the Tag(s) being “searched” for that page.
In the Tag:Entries loop, all of your weblog:entries variables and conditionals are available as well smile

One thing to note is that in my first example, you might have noticed the Tag word was linked to ‘tags/tag’

The ‘tags’ part refers to the template path, and the ‘tag’ part is NOT actually a template… it’s only a trigger in the URL for the Tag:Entries loop. So the path could very well look like:
‘template_group/template/tag’
Just be sure to keep the ‘tag’ part in the path. smile

 Signature 
Profile
 
 
Posted: 25 April 2008 11:31 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  22
Joined  2008-04-17

Perfect. This is exactly what I needed.

I did have a little bit of confusion over the last paragraph, but I got it working. I now have a URL that looks like this.

http://www.domain.com/tags/tag/citizenship

Is there a common convention among your users as to less redundant naming?

Profile
 
 
Posted: 25 April 2008 11:45 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  22
Joined  2008-04-17

Another question (due to the lack of examples in the documentation).

What am I supposed to do with this?

{exp:tag:cloud weblog="my_blog" groups="5" start="10" step="2" limit="40"} content {/exp:tag:cloud}

I tried this:

{exp:tag:cloud weblog="news" groups="5" start="10" step="2" limit="40"}{tag_name}{/exp:tag:cloud}

Nothing. Sorry, but I’m sure the detailed lists of parameters and variables will be useful once I figure out how to use the module ...

Profile
 
 
Posted: 25 April 2008 11:46 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

seajay,

Your URL may be whatever you wish. It could be:

http://www.domain.com/toys_department/preschool/tag/leap+frog

 Signature 
Profile
 
 
Posted: 25 April 2008 11:51 AM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  22
Joined  2008-04-17

As to the domain, I understand the /template_group/template/ format.

However, I want to show tags for all of the weblogs in the site ... so, I want the highest level URL possible, like

www.domain.com/tag/leadership+citizens

I tried a number of variations, but could not see how to have just /template_group/, so I was wondering, if I have to use 2 segments, is there a convention?

Profile
 
 
Posted: 25 April 2008 12:02 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

seajay,

The only way you could make you make your URL look like this:
www.domain.com/tag/leadership+citizens

Is if you use your MAIN Index template for your Tag:Entries loop, which I’d imagine would be rediculous.
I can say this… your URL structure can be HOWEVER you wish, but the “TAG” part of the url NEEDS to be there. It is what triggers the Tag:Entries loop, much like how the Categories URL_title structure works. It generates URL’s like this: www.domain.com/template_group/template/categories/pants
The “categories” part of the URL is not a template, but needs to be there to trigger the “Pants” category.

I’ve never given it much thought, but I’d imagine the reason for both Tag and Category “triggers” is to differentiate between Weblog Entry URL_Titles. smile

Additionally though… you can also use the marker="” parameter.
Apply the below parameter to the Tag:Entries loop:

marker="whatever_you_want_instead_of_tag"

That will allow you to produce URLs like: www.domain.com/template_group/template/your_custom_trigger/leadership+citizens

 Signature 
Profile
 
 
Posted: 25 April 2008 12:25 PM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  22
Joined  2008-04-17

Got it. Thanks!

Also, are there any examples of how to code and style a tag cloud like the attached?

Image Attachments
Picture 1.png
Profile
 
 
Posted: 26 April 2008 08:41 AM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

You would need to use the text-align: justify; CSS attribute, though it could get you into some trouble with browser compatibility/bugs.
http://www.cs.tut.fi/~jkorpela/www/justify.html

Stick the Tag:Cloud loop inside a table or div, and apply that attribute above smile

Also, if what I’m seeing is correct, you have two different shades of Blue for your Tags?
There’s a few workarounds for this… have a look at this thread:

http://www.solspace.com/forums/viewthread/667/

 Signature 
Profile
 
 
Posted: 30 April 2008 06:55 PM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  22
Joined  2008-04-17

Thank you. Exactly what I was looking for!

Profile