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

Muut Archive Legend

@Muut · Joined 9 years ago · 18337 posts · 3878 topics · 137 reputation

Badges

✏️ First Post 💬 Conversation Starter ❤️ Well Liked

Recent posts

  • Add asset (JS) to modular page? · 9 years ago

    ah I understand now. I was thinking it was down to the inheritance levels in twig but this makes sense. I've got it working now by updating the modular.twig.html with my JS. Thanks a lot

  • Add asset (JS) to modular page? · 9 years ago

    Calling parent() will not instantiate the parent, only return its object. In the context of modular-pages, their children - or modules - are not capable of adding assets upwards because they do not ex

  • Add asset (JS) to modular page? · 9 years ago

    My base has asset.js and my modular.twig.html file extends the base - {% extends 'partials/base.html.twig' %} - so I think I've got this covered no? I've adding {{ parent() }} to modular.twig.html

  • Add asset (JS) to modular page? · 9 years ago

    Is your modular page implementing assets.js() or inheriting it from base.html.twig? You need to have this somewhere in your template in order for js to be added to the page: {{ assets.js() }} ---

  • Add asset (JS) to modular page? · 9 years ago

    Hi I've got a modular page and one module in it needs some javascript but since its only one module I was trying to avoid adding it sitewide. I've tried adding this to my modular twig file but it just

  • Modular page can't get custom variables from base template · 9 years ago

    Hmm, it seems in modular page the global variable "pages" is not accessible too. I need to use page.parent.parent.children instead of pages.children.

  • Modular page can't get custom variables from base template · 9 years ago

    Sometimes I get this annoying problem and I have no idea what causes it. Form the base template file (partials/base.html.twig), I set the global variable for site and theme's configuration. {% set the

  • How can I print a specific modular page to my homepage modular template? · 9 years ago

    I was able to achieve what I needed by setting a custom order in the frontmatter of the main modular page like this: title: Home content: items: '@self.modular' order: by: default

  • How can I print a specific modular page to my homepage modular template? · 9 years ago

    If you have a unique identifier for each page tied into the title, you could do this. {% for modular in page.collection %} {% if modular.header.title == unique_identifier %} {{ Print what you

  • How can I print a specific modular page to my homepage modular template? · 9 years ago

    I am building my home page as a modular page. Ordering pages in the admin section won't satisfy my graphic design. I need to tell the template exactly which modular page to print at which position in