I need help with modular pages and custom blueprints

I have a blue print at the following location:
user/themes/klar/blueprints/modular/about-us-me.de.yml

And the page is here:
user/pages/03.home/_ueber-uns/about-us-me.de.md

Template here:
user/themes/klar/templates/modular/about-us-me.html.twig

Content of blueprint:

title: Gallery
form:
  fields:
    tabs:
      type: tabs
      active: 1

      fields:
        gallery:
          type: tab
          title: Gallery
          fields:
            header.an_example_text_field:
              type: text
              label: Add a number
              default: 5
              validate:
                required: true
                type: int

Content of page:

    ---
    title: 'Über uns'
    media_order: agentur.jpg
    test: test
    ---
    # Webagentur

The tab is not showing up, i cleared also the cache.
Is the langauge code the issue?

Thank you so much for your help!

Shouldn’t it be blueprints/modular/about-us-me.yml?

@patrick20, Welcome to the forum. Hope you will be going to enjoy Grav!

There are a few issues with the setup.

  • You are not using the default English language, but German. Therefor you will have to define the supported languages in ‘/user/config/system.yaml’
    languages:
      supported: [de]   # Add others if needed
    
  • Blueprints do not use the language (‘de’) as extension. All language use the same page blueprint. Only the content of the blueprint is translated.
    fields:
      gallery:
        type: tab
        title: THEME_KLAR.GALLERY   // this will be translated
    
    With the following in ‘/user/config/themes/klar/languages.yaml’:
    en:
      THEME_KLAR:
        GALLERY: Gallery
    
    de:
      THEME_KLAR:
        GALLERY: Galerie
    
  • You will probably want to extend the default configuration in your page blueprint for ‘about-us-me.yaml’. You should therefor tell Grav that it extends the default page:
    title: Gallery
    '@extends': default
    
1 Like

Thanks for your answer!
This has no effect, still don’t see the tab.

Sorry, try to remove the modular/ as well: blueprints/about-us-me.yml

Thanks for your answer!

This alone wasn’t enough to solve this issue.

This is the system config regarding the languages:

languages:
  supported:
    - de
  default_lang: de
  include_default_lang: true
  pages_fallback_only: false
  translations: true
  translations_fallback: true
  session_store_active: false
  http_accept_language: true
  override_locale: true 

default has be a blueprint?

Thank you, but this didn’t work.

Try changing the extension from yml to yaml. :wink:

Worked for me.

2 Likes

@patrick20, The blueprint ‘default’ to extend from is already defined by Grav in ‘/system/blueprints/pages/default.yaml’

The suggestion from @arkhi to replace ‘yml’ with ‘yaml’ does indeed make a difference…

It seems you are not the first to stumble on it. Here is an issue on the repo about Load .yml files as well as .yaml

2 Likes

@arkhi
@anon76427325

Thank you so much! The issue was indeed the yaml/yml and the language code.
The blueprint has to be in user/themes/klar/blueprints/modular/<blueprint>

Have a good day!

1 Like