-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Modular content of foreign pages #988
Comments
Actually looking at this, it seems that Try this.. in Pages.php.. around line 2367, you should see this:
if you change this to:
Then |
I guess you are talking about the Removing the the call to |
ok try replacing the current lines 2375 - 2401 with:
Then try with |
works like a charm 👍 |
Cool will commit it then :) |
Hello ! I'm sorry but I don't understand if it is possible in the latest version of grav to call a modular on another page :( I tryed to do as you instructed without success. Can you please help ? |
it would be great if something like this was possible:
My use case is the following: I have 5 info boxes that appear on several pages in the sidebar.
Eg the homepage and the contact page both have an info box with contact information in the sidebar. And a few other pages all have the same "download the latest version" box in the sidebar.
I do not want to duplicate those boxes across all pages because it's tiresome to update them once their content changes. I just want to create each box once and then include them into each pages sidebar collection.
Currently it's only possible to include single pages via
@page.self: /my/page
into a collection but from my point of view my boxes are not real pages but modular fragments so I would prefer to create them as modular (boxes/_contact
instead ofboxes/contact
) but@page.self: /my/_page
is not working. ( I guess because it relies on the page being routable?)Creating the boxes as real pages instead of modular fragments also has the disadvantage that the twig template is not automatically rendered.
So if I do
@page.self: /boxes/contact
and in my parent page's template:while having the page defined as
/boxes/contact/white-box.md
and antemplates/white-box.html.twig
in my theme,the
module.content
which is printed inside the loop does not consist of the renderedwhite-box
template but just contains the plain markdown content. So currently I have to workaround this by doing:I hope my use case is understandable. It would be really cool if it was possible to add single modular fragments from other pages to a page's collection and get their modular template rendered correctly when outputting the collection items.
The text was updated successfully, but these errors were encountered: