0

I'm using a theme that use background image in template like this:

{% if page.header.background_image != '' %}
    {% set background_html = 'style="background-image: url(' ~ page.media.images[page.header.background_image].url ~ ');"' %}
{% else %}
    {% set  background_html = "" %}
{% endif %}

In other page templates (in admin) I can see upload field, but not in modular - I see only title and order of modules.

I want to take advantage of image upload, but I can find place to put them, nor add it in the modular.yaml in the theme (I don't want to edit modular from the grav installation).

My goal is to edit theme in the manner where I can use the image upload.

Zbyszek Kisły
  • 2,110
  • 4
  • 26
  • 48

1 Answers1

1

As answered in Grav's discourse forum: If themes does not provide a modular.yaml file, it will use the one provided by antimatter, which seems to be the case with your theme. This modular.yaml does not provide a pagemedia field which allows you to add medias.

Thus, you only have two solutions:

  • Add your own modular.yaml file in themes/yourtheme/blueprints folder and add a pagemedia field
  • Add your media manually via ftp

Hope it helps

Paul

Paul Massendari
  • 417
  • 3
  • 6