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

Simplesearch "tag" search query

Started by Mat 7 years ago · 0 replies · 583 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 Paul Hodges, 4 weeks ago
19 484 5 days ago
Support · by Lauw, 7 days ago
2 99 7 days ago
Support · by Anna, 3 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 484 3 weeks ago