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

Sidebar content using Quark

Solved by Louis Cox View solution

Started by Louis Cox 5 years ago · 2 replies · 1146 views
5 years ago

Hi,

So I read through many of the postings regarding this matter - I wanted to add a sidebar to the basic theme, Im using just the basic Grav download with quark added and necessary plugins.
The route suggested is that you create a page thats hidden called sidebar from which the content is extracted, and then displayed.

So the page responsible for doing this is partial sidebar.html.twig - all good this makes sense. Reading that - you get the line

{{ page.find('/modules/sidebar').content|raw }}

And reading another posting relating to another theme this seems to have been truncated to be like this,

{{ page.find('sidebar').content }}

Now, when I edit the sidebar.html.twig - and swap out this line it works as expected. but I have to say that its a bit confusing as to why its set to this? perhaps someone can explain?

{{ page.find('/modules/sidebar').content|raw }}

many thanks

5 years ago

@louigi, What exactly do you want to achieve?

  • Do you want to display/reuse the content of a certain page (or module) inside the sidebar of another page or pages?
  • Or do you want to create a sidebar containing the output of plugins? Like a SimpleSearch, Popular Categories, etc. See the Blog demo.
5 years ago Solution

Hi,

Well both if Im honest - I want a bit of an editable page and also have some plugin / feed stuff.

I have that now - as Ive edited the sidebar.html.twig file. Its looking for the sidebar page in blog folder and its automatically chucking in bits from the plugins.

I was just confused as to why in the twig file its going to /modules/sidebar - why not simply /sidebar as Ive used which obviously works?

many thanks

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 10 hours ago
Support · by Anna, 3 days ago
2 60 13 hours ago
Support · by Justin Young, 14 hours ago
1 30 14 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago