Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Simplesearch "tag" search query

Started by Mat 7 years ago · 0 replies · 654 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 webmasterodp, 7 days ago
4 145 6 days ago
Support · by nwhitfield, 1 week ago
2 126 1 week ago
Support · by stell, 3 weeks ago
5 364 2 weeks ago
Support · by gravinator, 1 month ago
5 556 2 weeks ago
Support · by Gravver, 3 weeks ago
6 344 3 weeks ago