Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Simplesearch "tag" search query

Started by Mat 7 years ago · 0 replies · 497 views
7 years ago

Hello, I've installed and configured simpleaserch plugin, all works, I have a page for search, all works. But how I can search using tags?

On my product pages, I have at the end a list of tag used, I need when the people click on specific tag, will be opened a search page with a list of post with this tag...

Now I use this section in the product page, for tags, in twig template:

TWIG
<div id="tags">
<div class="container grid-xl p-vr">
    <hr>
    <p class="text-gray text-right">Tags: 
    {% for tag in page.taxonomy.category %}
        <a class="chip" href="search/tag:{{ tag }}">{{ tag }}</a>
    {% endfor %}
    {% for tag in page.taxonomy.tag %}
        <a class="chip" href="search/tag:{{ tag }}">{{ tag }}</a>
    {% endfor %}
    {% for tag in page.taxonomy.brand %}
        <a class="chip" href="search/tag:{{ tag }}">{{ tag }}</a>
    {% endfor %}
    {% for tag in page.taxonomy.model %}
        <a class="chip" href="search/tag:{{ tag }}">{{ tag }}</a>
    {% endfor %}
    </p>
</div>

</div>

But not works. Some suggestion?

thanks

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 57 14 hours ago
Support · by Anna, 3 days ago
2 65 17 hours ago
Support · by Justin Young, 18 hours ago
1 33 18 hours ago
Support · by Duc , 1 week ago
2 68 5 days ago
Support · by Colin Hume, 1 week ago
2 60 6 days ago