typemill / typemill

Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible website and eBook creation using Markdown.
https://typemill.net
MIT License
427 stars 60 forks source link

Get image from items inside folder #102

Closed kerngebiet-digital closed 4 years ago

kerngebiet-digital commented 4 years ago

Hello,

i want to list items from an folder including the first image of each entry. Is this possible, an upcoming feature or extendable by a plugin?

Regards Chris

trendschau commented 4 years ago

Hi Chris,

unfortunately this is not easily possible right now, but it is an important feature, so I will add it to release 1.3.5. Release 1.3.4 with a new media-library will be published tomorrow probably.

Just as a implementation-reminder for me:

That's it basically, but requires an image field-type for the form-builder...

trendschau commented 4 years ago

If this is very urgent, then there might be another (more dirty) workaround:

I could add that event to the release tomorrow and you could create your own plugin then.

kerngebiet-digital commented 4 years ago

Thank you for the great response! Its not urgent but important for daily use. I try to add a custom field in meta where i put the preview image url. Very curious about the next release!

Regards Chris

trendschau commented 4 years ago

Yes, that is a simple and clever workaround! :)

kerngebiet-digital commented 4 years ago

Ok but i dont get the metatabs content outside of the detail page?

trendschau commented 4 years ago

Yes, you can, it is described here: https://typemill.net/theme-developers/helper-functions#list-articles

I am not super sure, what you want to achive. Generally, you can use the meta-content of pages inside a folder wherever you want. An example of this can be found in the dev-theme or in the emergency theme: https://themes.typemill.net/

This only works with one or more pages inside a folder. If you want to get the meta-information only one single page: That is not possible right now but I can implement that in the next release, a feature like that makes sense for a manually added article teaser for example ...

I will implement an image-fied-type for the next release, too (or try to) ...

trendschau commented 4 years ago

or better said: the function getPageMeta(settings, article) is there already, but you need to get the item-object (= article) of the page. I am in a hurry right now and have to look into the code if there is some workaround already ...

kerngebiet-digital commented 4 years ago

Very nice getPageMeta(settings, article) helped. Its not that intuitive at first but performance driven.

trendschau commented 4 years ago

Preview of the next version 1.3.6, it provides a new field-type for images that you can use in meta-tabs:

heroimage

trendschau commented 4 years ago

published with version 1.3.6 today