0

I have a snippet which displays all entries within a channel and I want to have displayed entries only from a particular tag, but I'm not able to display tagged entries. Then I have decided to display all tagged entries without limitation (code below) but this is not working either.

{exp:channel:entries channel="products" orderby="title" sort="asc" limit="8" status="open" paginate="bottom" dynamic="no"}
{exp:tag:related_entries}
    {if switchee_no_results}
            <div class="no-entries"><p>No entries yet.</p></div>
        {/if}

        <div class="col-md-3 col-sm-6 category-item">
            <a href="{site_url}{segment_1}/{segment_2}/{url_title}">
    {product_image limit="1"}
            <img src="{product_image:image}" alt="{product_image:title}" class="img-responsive">
    {/product_image}    
            <h3>{title}</h3>
            </a>
        </div>

{switch='|||</div><div class="row row-category">'}

    {paginate}
    {exp:stash:set}

      {stash:pagination_links}{pagination_links}{/stash:pagination_links}

    {/exp:stash:set}
    {/paginate}

{/exp:tag:related_entries}     
{/exp:channel:entries}

Even switching code to

{exp:tag:related_entries channel="products" orderby="title" sort="asc" limit="8" paginate="bottom"}
<h3>{title}</h3>
{tag_paginate}
    <p>Page {tag_current_page} of {tag_total_pages}. {tag_pagination_links}</p>
{/tag_paginate}
{/exp:tag:related_entries}

doesn't do anything.

Another simple test - template below

   1. 
        {exp:tag:entries tag="test"}
    2.
        {if switchee_no_results}
            <div class="no-entries"><p>No entries yet.</p></div>
            {/if}

        <h3>{title}</h3>
    3. 
    {/exp:tag:entries}

is displaying only 1. for me, so it looks like tag tag is not working withing templates.

Any clue why is not working? I'm running EE 2.7.3 and Tag 4.2.5

Thanks

  • What version of Tag and EE are you using? Also, try putting your code on a regular template (not a snippet), at least to eliminate snippets as a possible point of issues. Also, looks like {exp:tag:entries} would be the tag to use to display entries associated with a tag: solspace.com/docs/tag/entries – Solspace Mar 20 '14 at 2:17
  • OP updated. As I have mentioned previously - last test from OP is running as a regular template, not a snippet, and it looks like EE tag tag is not recognized at all. – JackTheKnife Mar 20 '14 at 14:19
  • If you're using {exp:tag:entries}, you must provide a tag either in the URL (with the correct URL "marker" segment, default being /tag/), or by using the tag="" parameter. If using {exp:tag:related_entries} (still not sure why you're using that tag), you need to provide an entry_id through the URL or through the entry_id="" parameter. – Solspace Mar 21 '14 at 6:02
  • OP updated. Added tag="test" and still not getting anything, even 2 or No entries yet is not displayed. For me it just confirmation that EE tag tag is not recognized at all. – JackTheKnife Mar 21 '14 at 12:00
1

The solution was to use {exp:tag:entries} to display entries associated with a tag, but also make sure the status of those entries are set to "open", and if they aren't use the status="some_other_status" parameter.

| improve this answer | |
  • Feel free to add to the solution if there are additional details to add. – Solspace Mar 25 '14 at 4:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.