ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Tag module question

July 29, 2010 4:09am

Subscribe [2]
  • #1 / Jul 29, 2010 4:09am

    oscaralexander

    11 posts

    I’m working on my first EE (2.1.0) project and so far it’s kicking ass. I just purchased Solspace Tag 3.0.1 and installed everything according to instructions. Now there’s two things I’m running into. I’ve posted this very same post on the Solspace forum, but got no help so far. Perhaps you guys can help me out 😊

    1. When I iterate over my blog entries I would like to know if an entry has any tags associated with it before I open the {exp:tag:tags} tag. This tag is wrapped by a UL that would otherwise be useless and mess up my white space.

    2. The Control Panel instructions show the tags field as part of the Publish tab. I’ve added a new custom Tag Field Type to my field group, yet it only shows the “Suggest tags” button. And when I click it, the form submits. I solved this temporarily by adding a Tags tab, but I’d rather have it right there at the Publish tab. How?

    Perhaps this is a jQuery/AJAX related bug, but I found the jQuery CP note a little confusing since I understand it comes default with EE 2.1.0.

    Any help would be much appreciated!

  • #2 / Jul 29, 2010 10:18am

    Boyink!

    5011 posts

    For #1 have you tried using the count and total results variables with a conditional?

    {exp:tag:tags}
      {if count==1}
       <ul>
      {/if}
    
      <li>{tag}</li>
    
      {if count==total_results}
        </ul>
      {/if}
    {/exp:tag:tags}
  • #3 / Jul 29, 2010 6:33pm

    oscaralexander

    11 posts

    Hi Boyink! Thanks for taking the time to reply! Unfortunately, the {count} variable returns number of the weblog entry currently being rendered. At least when nested within the {exp:channel:entries} tag… Weird. I guess Solspace still has some bugfixing to do? Here’s the code I use (stripped for brevity):

    {exp:channel:entries channel="blog"}
        {exp:tag:tags dynamic="off" entry_id="{entry_id}" type="weblog"}
            {if count == 1}<ul class="tags">{/if}
            <li><a href="/blog/tag/{websafe_tag}">#{tag}</a></li>
            {if count == total_results}</ul>{/if}
        {/exp:tag:tags}
    {/exp:channel:entries}
  • #4 / Jul 29, 2010 7:18pm

    Boyink!

    5011 posts

    Looks right to me.  I’d post in the Solspace support forums.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases