I can't get modules plugin to work

@lukasbestle

Today I tried the modules plugin for the first time but it does not go that well.

Page blueprint

title: Company
pages:
  build:
    - title: _modules
      uid: modules
      template: modules
files: true
fields:
...

Files in site/modules/table/:

table.yml
table.html.php

table.yml

title: Table
pages: false
files: true
fields:
  title: Title table
  type: title

modules blueprint

title: Modules
pages:
  template:
    - module.table

When I’m in page company/modules and add a page I get this:

I would expect to select the module table here. What is wrong?

That should actually work. Have you checked your indentation? Made sure the file names are really correct? Cleared the cache?

I got it to work. The problem was that my plugin folder was named modules-plugin like the repo and it did not match the file inside.

However, a new error is popping up. Do you know the reason for this?

This is usually due to an error in your blueprint, in this case the table blueprint.

In the table.yml I guess? I don’t think there are any errors in that? :confused:

title: Table
pages: false
files: true
fields:
  title: Title table
  type: text

Your field does not have a name. Should be:

title: Table
pages: false
files: true
fields:
  title:
    label: title
    type: title

:confounded: Aghhh, yes. How could I miss that one? :confused: I will blame the poor sleep I had last night. :wink:

Thanks! :slight_smile:

I have the same problem. When I try to add a module in _modules, just the ‘default’, locked template option appears.

Page blueprint

title: Page
pages:
  build:
    - title: _modules
      uid: modules
      template: modules
fields:
  title:
    label: Title
    type: text

Files in site/modules/imageText/:

imageText.html.php
imageText.yml

imageText.yml

title: ImageText
fields:
  title:
    label: title
    type: text

modules blueprint

title: Modules
pages:
  template:
    - module.imageText

Does the plugin folder have the correct name, i.e. /site/plugins/modules/?

Yes. Also my version of Kirby is 2.5.5 if that has any relevance.

Just a guess because I can’t test this right now. Does it change anything when you change your module to just lowercase?
site/modules/imageText/ to site/modules/imagetext

Edit:
Does one of the “default” modules (gallery, text) work?

Yes, that was it. I should have tried that. Thank you!