'text' fields are not supported in theme fields.json

SOLVE
andireuter
Participant

I get this weird issue in only 1 module of multiple modules I build. I just added the fields.json and the "hs watch" starts complaining about

 

 

'text' fields are not supported in theme fields.json

 

 

If I remove the "image_box_heading" and "image_box_text" everything works fine again. I use the same "text" fields in my other modules.

My module fields.json:

 

 

[
  {
    "name": "image_box_heading",
    "label": "Image box heading",
    "locked": false,
    "type": "text",
    "required": true,
    "default": "Your Hero"
  },
  {
    "name": "image_box_text",
    "label": "Image box text",
    "locked": false,
    "type": "text",
    "required": true,
    "default": "Nam porttitor blandit accumsan. Ut vel dictum sem, a pretium dui. In malesuada enim in dolor euismod, id commodo mi consectetur. Curabitur at vestibulum nisi..."
  },
  {
    "name": "image_box_image",
    "label": "Image box image",
    "locked": false,
    "type": "image",
    "required": true,
    "responsive": true,
    "resizable": false,
    "show_loading": false,
    "default": {
      "size_type": "auto",
      "src": "{{ get_asset_url('/nuaware/website/img/spacer-img.jpg') }}",
      "alt": null,
      "loading": "disabled"
    }
  },
  {
    "name": "toggle_box",
    "label": "Show image on the left",
    "locked": false,
    "type": "boolean",
    "display": "toggle",
    "required": true,
    "default": false
  }
]

 

 

Who knows about this issue?

0 Upvotes
1 Accepted solution

Accepted Solutions
andireuter
Solution
Participant

Yes, I forgot to add suffix ".module" at the name of the module folder. 🙄

Thank you!

View solution in original post

5 Replies 5
Ntbrown
Contributor

This should be a module not a theme setting....

 

And usages like this give good reason to the product team to not add text fields.

 

Which is understandable, when used wildly improperly this way, but it's a shame such proliferative misuse by novice methodologies causes significant detriment within themes as text fields do have valid use cases for advanced scenarios and settings that do in fact require text fields to properly manage.

 

This is not one of those cases.

0 Upvotes
andireuter
Participant

Maybe I didn't wrote that my sample above is from my module, not the theme fields.json. But the cli prints this weird error message. This confuses me. In modules the "text" type is a valid field. But the cli treats my module fields.json as the theme fields.json. Any idea?

0 Upvotes
Ntbrown
Contributor

@andireuter  Post an MVP / reproducable version. I.E. - a sample theme giving you this and commands + module directory. Your structure is wrong somehow somewhere.

0 Upvotes
andireuter
Solution
Participant

Yes, I forgot to add suffix ".module" at the name of the module folder. 🙄

Thank you!

View solution in original post

Ntbrown
Contributor

You're aware there's a create module command right...? It does the folder etc for you.

 

If you're using watch and trying to create it manually due to this... Just use two terminals lol 

 

One for subprocesses the other for one offs per all development workflows ever.