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

Which modular templates to use for what?

Started by Ben Opp 4 months ago · 4 replies · 96 views
4 months ago

hello, I’m new to web dev and to Grav, and I’m trying to create a modular landing page - For a one-page style landing page with several subsections, that can be reached via the menu, a modular page seems like the right choice, right?

When creating a new module with the Quark theme, I was wondering what the best template for each module would be - the way I understood it, each template has a different set of features available, correct? Or could I put any element (e.g. gallery) on any page, no matter the chosen template? The available choices in my installation are features, gallery, hero and text. I couldn’t find a description of them in the docs - maybe I overlooked something? If so, could someone point me to a good ressource about the modular templates - or else tell me a bit more about them so I could make more informed choices?

I’m basically trying to recreate this site as a one-pager, so each page would go into a module on a modular page - or would you say that’s the wrong approach? Thanks for any advice!

4 months ago

@bennypr0fane,

A few remarks:

  • Have you read the docs on modular/module pages?
  • Whether to use modular pages depends on what you are trying to achieve. They come with their own specific behaviour.
  • A modular page can show any combination of modules provided by a theme.
    The set and order of modules is defined by the collection defined in the modular page.
  • The template for a module can be used multiple times in a single modular.
  • Modules can be shown in any order you like.
  • The set of modules provided by a theme is not fixed, you can create and/or alter module templates at will.

If so, could someone point me to a good ressource about the modular templates

You could download the One-Page Site skeleton which gives you an idea of using a one-page modular.

👍 1
4 months ago

Hello and welcome. i just visited your website. this is unrelated to your question and i hope this wont bother you but your image's size on page should be reduced imo which is hard to load and effects SEO - U/X.

👍 1
4 months ago

Thanks for the comments!

@pamtbaau:
Have you read the docs on modular/module pages

Yes, I have. They explain how a modular page works, but my question is specifically about each of the modular templates, I didn’t see these explained in detail.

@pamtbaau:
The set of modules provided by a theme is not fixed, you can create and/or alter module templates at will.

That’s good to know.

I’ll also check out the One-Page skeleton, thanks for the pointer!

4 months ago

@bennypr0fane,

my question is specifically about each of the modular templates, I didn’t see these explained in detail.

Every theme defines its own set of unique custom templates. There is for example no standard implementation of the "features" module template. The templates defined by a theme have no relation with any other theme's template using the same name. Not in functionality, not in layout, not in styling and not in implementation.

The main Grav documentation is about understanding general concepts.
The chapter about "Modular Pages" happens to use the Quark theme's based One-Page skeleton. Explaining the functionality of the "features" template of Quark in the general docs, would not apply to any "features" template in any other theme.
It's up to the theme developer to describe its templates in the README (if the owner wants to).

👍 1

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 9 hours ago
Support · by Anna, 3 days ago
2 59 12 hours ago
Support · by Justin Young, 13 hours ago
1 30 13 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