Created a picture tag for KirbyText. Although the picture element works for all responsive images, it is advised to use it for art directional purposes. I am planning to make a ‘srcset’ tag for responsive images without art direction.
The tag could probably be optimized, but works for now. Of course all feedback is welcome. It makes sure you have to write as little as possible: (picture: filename) and it works if you use the correct naming conventions. More information can be found on GitHub: https://github.com/bartvandebiezen/kirby-v2-picture-tag
Which two tags? picture and srcset?
Could you please post the Kirbytext you are using, a list of files in the page’s content directory and the source code that gets rendered (not the tree view, but the Cmd-Alt-U representation of that area of the page)?
PS: Just in general: “It doesn’t work” makes it very hard to reproduce the error and to find the reason for it. The more input you provide with your bug report, the better the output from us gets. My crystal ball is being repaired right now, so sorry for that.
I’m using both extentions each from the latest master branch, with original Kirby 2 Starterkit installation, no PHP file changed except the ‘Progect A’ (project.txt file) witch I added: (picture: forrest.jpg) and (srcset: forrest.jpg), to the ‘Text’ field.
You are using the extension in your tag. See the docs:
You can use this KirbyText tag in your text as:
(picture: scrum-process extension: png class: infographic caption: This is how Scrum works. alt: Scrum infographic width: 600px height: 400px)
Be careful, you need to write the filename without an extension. The extension is written as a separate attribute. When you do not use the extension attribute, the extension will be ‘jpg’.