Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying Content From Modular Pages #93

Closed
LukeAskew opened this issue Jan 26, 2017 · 4 comments
Closed

Displaying Content From Modular Pages #93

LukeAskew opened this issue Jan 26, 2017 · 4 comments

Comments

@LukeAskew
Copy link

More of a question - the content from my site is mostly in modular pages. Searching matches the appropriate parent page, but the content is empty because the parent's content is non-existent.

I was able to work around this by commenting out this block so that modular pages are included in the results.

I modified my search result loop to display the parent page name but the modular page content.

Is there a better way to include the modular page's content in search results?

@flaviocopes
Copy link
Contributor

It should search inside the modular content, but the page shown in the search should be the parent page, as a modular page "part" is not really a page, just a portion of it.

@LukeAskew
Copy link
Author

Right, but the modular page actually contains the content, so if I want to display a meaningful search result, I need that content in the page model.

@mikegcox
Copy link

I cannot get SimpleSearch to give results on Modular pages at all. I tried the mod by Luke but that did nothing either. I want to be able to search the entire site. Is there a setting I am missing?

enabled: true
built_in_css: false
display_button: true
min_query_length: 3
route: /search
template: simplesearch_results
filters:
filter_combinator: or
ignore_accented_characters: true
order:
  by: date
  dir: desc

@mikegcox
Copy link

My workaround in case someone is looking for an idea. I created a series of pages with duplicate content using just the default template. I added a button to the default.html.twig template and a corresponding text field in the default.yaml blueprint. Each page that I created now links to the content where I actually want the visitor to go. Each page has a "robots" - "noindex" metatag so that my duplicate content is not found by google. I then modified my simplesearch_item.html.twig to set my href to:

{% if page.header.button %}{{ base_url }}{{ page.header.button }}{% else %}{{ page.url }}{% endif %}

Now the user finds the page I want them to find and never sees the duplicate pages. They are just for index words.

Kind of a long process, but it only took an hour and it is perfect for the end user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants