We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Module: Tagger Lite *** Now Available in EE2 *** Tag Your Entries in EE2

Development and Programming

Danny T.'s avatar
Danny T.
426 posts
16 years ago
Danny T.'s avatar Danny T.

Brad,

I just gave 1.1.0 a shot on 2.x. Tags are mispositioned outside of the “Assigned Tag” containers when they are selected for the entry. The containers are also not wrapping with shorter widths.

Great work. Keep up the good job mate. Hope this helps!

Update: Attached a screenshot.

       
Brad Parscale's avatar
Brad Parscale
196 posts
16 years ago
Brad Parscale's avatar Brad Parscale

Just want to make sure you replaced the whole themes folder. What theme are you using?

       
Danny T.'s avatar
Danny T.
426 posts
16 years ago
Danny T.'s avatar Danny T.

Yep — I’ve updated themes in addition to the third party folder for Tagger Lite a couple times for good measure. For theme, I’m using the default theme with Newism Morphine’s theme files.

       
Manuel Payano's avatar
Manuel Payano
144 posts
16 years ago
Manuel Payano's avatar Manuel Payano
Yep — I’ve updated themes in addition to the third party folder for Tagger Lite a couple times for good measure. For theme, I’m using the default theme with Newism Morphine’s theme files.

Let me try out Newism Morphine theme. Never installed it.

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

I’m using this module and it’s very simple to set up and get running. Would it be possible to have a new parameter added weblog=”” so one could limit to tags within a particular weblog?

       
timd's avatar
timd
14 posts
about 16 years ago
timd's avatar timd

Hello, and thanks for a great add-on!

I’m able to get the tag cloud to display fine but I’m unclear as to what the URL structure should be for when a user clicks on the tag - In order to get other associated posts with the same tags to display?

Currently using the following example code in EE2 from the documentation:

{exp:tagger:cloud limit="100" backspace="1" min_size="13" max_size="26" prefix="tags"} ]{tags:tag_name} {/exp:tagger:cloud}

And when a user clicks on the tag (let’s say “blue” for example), they’re taken to www.mysite.com/(channel_name)/tag/blue/

  • but the template is broken and it’s showing ALL posts, not just posts containing the tag “blue”. Am I missing something here on the link / url structure, or do I need to set up a new template to display related posts?
       
Brad Parscale's avatar
Brad Parscale
196 posts
about 16 years ago
Brad Parscale's avatar Brad Parscale

You need to use:

{exp:tagger:entries_quick tag="{segment_3}" prefix="tags"}
    {exp:weblog:entries weblog="blog" entry_id="{tags:entry_ids}" dynamic="off" limit="20"}
        <h3>{title}</h3>
    {/exp:weblog:entries}  
{/exp:tagger:entries_quick}
       
Manuel Payano's avatar
Manuel Payano
144 posts
about 16 years ago
Manuel Payano's avatar Manuel Payano

The proper way to do it is:

For the template: http://www.mysite.com/(channel_name)/tag/blue/

{exp:tagger:entries_quick tag="{segment_3}" prefix="tags"}
    {exp:weblog:entries weblog="blog" entry_id="{tags:entry_ids}" dynamic="off" limit="20"}
        <h3>{title}</h3>
    {/exp:weblog:entries}  
{/exp:tagger:entries_quick}

Edit: Brad beat me to it.

       
leeaston's avatar
leeaston
634 posts
about 16 years ago
leeaston's avatar leeaston

Hi DevDemon, is it possible to filter by tag on the front end?

For example tags: mon tue wed thu fri sat sun and tags: uk us fr ru de

Is it possible to have clickable mon tue wed thu fri sat sun tags to show weblog entries tagged with the clicked day, and then to have clickable uk us fr ru de tags to further filter the weblog entries to show only weblog entries with the tags clicked?

Best wishes Lee

       
tb1200's avatar
tb1200
18 posts
about 16 years ago
tb1200's avatar tb1200

Thanks Brad and DevDemon - After banging my head around, I realize it was the prefix tag giving me grief… I didn’t catch the note that EE2 uses “tagger” by default so your response with the new prefix did the trick. Thanks so much guys.

       
Stake's avatar
Stake
22 posts
15 years ago
Stake's avatar Stake

Can someone kindly post a site using Tagger Lite and the code associated with it? I’m having a hard time understanding the tagging syntax.

Specifically, I want a blog entry to show the tags associated with the post but I can’t seem to have anything show up. I tried but all it does is break the rest of my entry after my paginate code:

{exp:tagger:entries_quick tag="{segment_3}"}
{exp:channel:entries entry_id="{tagger:entry_ids}"}
    <h4>{title}</h4>
{/exp:channel:entries}
{/exp:tagger:entries_quick}

What I’d like to have show up in this blog template is this (The titles and entries work already):

“My First Entry” Content Content Content Content

Tagged under: Tag 1, tag 2

I’m using 2.0 BTW.

I can get the cloud to show up on a sidebar section using the cloud tags but the links don’t go anywhere. Do I need to make a template specifically for tags?

       
Manuel Payano's avatar
Manuel Payano
144 posts
15 years ago
Manuel Payano's avatar Manuel Payano

To show tags assigned to a specific entry:

{exp:channel:entries channel="foo"}
<h1>{title}</h1>

{body}

{exp:tagger:tags entry_id="{entry_id}"} {tagger:tag_name}, {/exp:tagger:tags}


{/exp:channel:entries}

About the tag cloud question, yes you need to create a seperate template to handle channel entries display by Tags

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
15 years ago
Sean C. Smith's avatar Sean C. Smith

Cross posting here from your forum thread:

My client has a few hundred entries tagged using Tagger Lite and now wants to edit the tags so that they are all capitalized. Currently it’s random whether they are captilized or not and this is affecting the alphabetical listings as Capitalized entries are listed before lowercase. Is there some way to edit tags and not entries so that all entries with a tag have the tag renamed appropriately? EE 1.6.8 Tagger Lite 1.1.0
       
Filip Vanderstappen's avatar
Filip Vanderstappen
16 posts
15 years ago
Filip Vanderstappen's avatar Filip Vanderstappen

I just modified Tagger Lite to create an additional function to show related entries of a specific entry_id.

The added tag is called exp:tagger:related with the following parameters :

  • entry_id (obligated)
  • limit (default = 30)
  • prefix (default = tagger)

Usage :

<h2>Related blogposts</h2>
    <ul>
    {exp:tagger:related entry_id="{exp:channel:entries channel="blog" url_title="{segment_3}"}{entry_id}{/exp:channel:entries}" limit="5" prefix="tags"}
      {exp:channel:entries channel="blog" entry_id="{tags:entry_ids}"}
        <li><a href="/blog/article/{url_title}">{title}</a></li>
      {/exp:channel:entries}
    {/exp:tagger:related} 
    </ul>

To get this working you have to add the code blow to mod.tagger.php in your third-party folder tagger. The modified file is also in attachment of this post.

function related()
    {

        // Variable prefix
        $prefix = $this->EE->TMPL->fetch_param('prefix', 'tagger') . ':';

        // We need an entry_id
        $entry_id = $this->EE->tagger_helper->get_entry_id_from_param();
        
        if (! $entry_id)
        {
            $this->EE->TMPL->log_item('TAGGER: Entry ID could not be resolved');
            return $this->EE->tagger_helper->custom_no_results_conditional($prefix.'no_tags', $this->EE->TMPL->tagdata);
        }
        
    // PARAM
        $limit = ($this->EE->tagger_helper->is_natural_number($this->EE->TMPL->fetch_param('limit')) != FALSE) ? $this->EE->TMPL->fetch_param('limit') : 30;

        // Lets start on the SQL then.
        $this->EE->db->select('t.*');
        $this->EE->db->from('exp_tagger t');
        $this->EE->db->join('exp_tagger_links tl', 'tl.tag_id = t.tag_id', 'left');
        $this->EE->db->where('tl.item_id', $entry_id);
        $this->EE->db->where('tl.type', 1);
        $query = $this->EE->db->get();
        
        // No tags?
        if ($query->num_rows() == 0)
        {
            $this->EE->TMPL->log_item('TAGGER: No tags found.');
            return $this->EE->tagger_helper->custom_no_results_conditional($prefix.'no_tags', $this->EE->TMPL->tagdata);
        }
        
        $tmp_tags = array();
        
        // Loop through the result
        foreach ($query->result() as $row)
        {
          array_push($tmp_tags, $row->tag_name);
        }
                
        // Grab all entries with this tag
        $this->EE->db->select('tl.item_id, tl.tag_id');
        $this->EE->db->from('exp_tagger_links tl');
        $this->EE->db->join('exp_tagger t', 't.tag_id = tl.tag_id', 'left');
        //$this->EE->db->where('t.tag_name', $tag);
        $this->EE->db->or_where_in('t.tag_name', $tmp_tags);
        $this->EE->db->where('t.site_id', $this->site_id);
        $this->EE->db->where('tl.type', 1);
        $this->EE->db->limit($limit);
        $this->EE->db->group_by('tl.item_id');
        $query = $this->EE->db->get();

        // Did we find anything
        if ($query->num_rows() == 0)
        {
            $this->EE->TMPL->log_item('TAGGER: No channel entries found');
            return $this->EE->tagger_helper->custom_no_results_conditional($prefix.'no_tags', $this->EE->TMPL->tagdata);
        }

        // Loop through the results
        $items = array();

        foreach ($query->result() as $row)
        {
          if( $row->item_id != $entry_id)
              $items[] = $row->item_id;
        }

        $vars = array($prefix.'entry_ids'    => implode('|', $items));

        $this->EE->TMPL->tagdata = $this->EE->TMPL->parse_variables_row($this->EE->TMPL->tagdata, $vars);

        // Resources are not free
        $query->free_result();

        return $this->EE->TMPL->tagdata;
    }

    // ********************************************************************************* //
       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.