Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Inserting images into markdown

admin

Started by Owain Catton 4 years ago · 4 replies · 1439 views
4 years ago

When you insert and image into the markdown of a page content from the editor, either by dragging/dropping or via the plus icon on the hover menu. Is it possible for the inserted markdown code, e.g. !(alt text)[image.jpg "image title"), to be read from an existing .meta.yaml file if present.

4 years ago

Not without coding, which I am guessing is off the table.

The best approach would be to customise your Twig template (so further down the pipeline) so that it pulls this information from your .meta.yaml file and adds it as a title attribute.

4 years ago

Yeah that is a bit beyond me but thanks for the direction. Maybe when I have spent more time with Grav I will investigate

4 years ago

I did something like this for Blog image headers, where you could provide some image credit text and even a link to be overlaid with the image, in my Open Bootstrap 4 theme - sample Twig https://github.com/hibbitts-design/grav-theme-bootstrap4-open-matter/blob/master/templates/partials/blog_item.html.twig#L76-L101 and live sample image https://demo.hibbittsdesign.org/grav-open-matter-course-hub/home/module-04

I am sure (LOL) that the twig could be improved but perhaps this might give you a few useful ideas etc.
Paul

👍 1

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 97 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 185 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 148 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 61 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 255 1 year ago