Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Sidebar content using Quark

Solved by Louis Cox View solution

Started by Louis Cox 6 years ago · 2 replies · 1410 views
6 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

6 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.
6 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 complanar, 6 days ago
6 147 20 hours ago
Support · by Rick Beebe, 6 days ago
2 103 3 days ago
Support · by blu3prince, 3 days ago
0 55 3 days ago
Support · by alex, 4 days ago
2 96 3 days ago
Support · by Marcel, 2 weeks ago
1 146 4 days ago