I want that the client will be able to add a caption either for an image and for the text as well.
so actually I need a text block with two text fields.
So I changed the text.yml to this:
thanks!
Eventually this article had exactly what I needed. I created a new plugin for a custom footnote block and it works perfectly.
I have another question related to this subject:
I wish to add a custom id field for the image fieldset in the blocks.
I changed the image yml file and added a new field for that.
Now I want the custom id to be shown next to the image in the panel. Since I use the image block in several pages - I want this custom id to be shown only in a specific page in the panel…
So my question is this:
should I create a new custom field for that with a new plugin?
or can I change the preview of the image block only in a specific page?
I’m a bit confused… this is my yml:
- width: 1/2
type: fields
fields:
notes:
type: blocks
fieldsets:
text:
label: foot note
type: group
fieldsets:
footnote:
name: Foot note
fields:
text:
type: text
customid:
label: number of foot no
type: text
media:
label: painting
type: group
fieldsets:
- image
I hope it is understood. I would appreciate any help,
Thanks!
I think it’s probably better if you create a custom block. Otherwise you’d need a way to check if you are on a given page (via the URL for example), and then show the id conditionally.
I have an issue with creating a new image custom block:
I try to create a plugin for it (index.js, index.css, index.php) and since I use ‘type: files’ in my yml file, I’m not quite how should I call it in the index.js to get the preview of the image. This is my poor try: