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

Problem with setting up the simple search plugin

plugin plugins

Started by Ruben 8 years ago · 0 replies · 689 views
8 years ago

Hi there! I have a question about a theme I'm making. It's a website that has a news section. Here several news articles will be listed. For this I've used a modular page. There is a limit of news articles per page and pagination is being used. I'd like to implement the simplesearch plugin here to search through the news articles but for some reason I cannot get it to work. I've googled around and followed the steps in the documentation a couple of times now but don't know where this is going wrong. Could someone maybe help out? In the site.yaml I've declared the following taxonomy variables: taxonomies: [category,tag,author,title,subtitle]

The pages .md file looks like this:

YAML
    ---
    title: News
    menu: News
    slug: news
    page_type: news_list
    content:
        items: '@self.children'
        order:
            by: header.date
            dir: desc
        pagination: true
        limit: 3
    modular:
        items: '@self.modular'
        order:
            by: default
            dir: asc
            custom:
                - _landing-news-list
                - _news-list
                - _stay-informed-news-list
    static:
        read: Read
    ---

And the frontmatter.yaml (in the pages folder) like this:

YAML
simplesearch:
    route: @self
    filters:
        - @self
        - @taxonomy: [category,tag,author,title,subtitle]
    filter_combinator: and

In the news page folder there is the following structure:
PARENT
.._01.modular
.._02.modular2
..01.new_article_1
..02.new_article_2
..03.new_article_3

Each of these news articles .md files looks somewhat like this:

YAML
---
title: 'This is a news article!'
taxonomy:
    tag: [article, news,]
    author: 'Author'
    title: 'This is a news article!'
    category: news_item
continue_link: true
page_type: news_item
content:
    items: '@self.modular'
    order:
        by: default
        dir: asc
        custom:
            - _landing-news-item
            - _news-item
---

Some content!

I tried following the documentation on the github very closely but for some reason I just cannot get it to work properly.

Suggested topics

Topic Participants Replies Views Activity
Support · by Duc , 3 hours ago
1 23 3 hours ago
Support · by Thomas, 1 week ago
3 102 12 hours ago
Support · by Anna, 3 days ago
2 99 1 day ago
Support · by Justin Young, 1 day ago
1 66 1 day ago
Support · by Duc , 1 week ago
2 101 6 days ago