Muut Archive Legend
@Muut · Joined 9 years ago · 18337 posts · 3878 topics · 137 reputation
Badges
Recent posts
-
Best way to get first image from collection
· 11 years ago
This seems to work and stops iteration as soon as it finds an image: {% set thumbUrl = url('theme://images/thumb.jpg') %} {% set break = false %} {% for post in posts if not break and post.media.image
-
Best way to get first image from collection
· 11 years ago
Something like {% for post in posts %} {% if post.media.images %} {% set thumbUrl = post.media.images|first.url %} {% endif %} {% endfor %} unfortunately twig cannot break in a loop, b
-
Best way to get first image from collection
· 11 years ago
Thanks for the example. I tried accessing posts.media, but it's always null. Here's how I can get the first post's image url like in antimatter, but I'd like to be able to get the first image regardle
-
Best way to get first image from collection
· 11 years ago
Antimatter has an example of this type of logic: https://github.com/getgrav/grav-theme-antimatter/blob/develop/templates/blog.html.twig#L6-L12
-
Best way to get first image from collection
· 11 years ago
What's the best way to get the first image from a collection if you don't know which pages have images? Thanks.
-
Grav Migration
· 11 years ago
Yes. You can of course think about other deployment possibilities later, but a simple move of your files to the server will work. (make sure the server satisfies the requirements listed on the learn s
-
Grav Migration
· 11 years ago
Since this is a flat-file CMS, is it just a matter of copy-paste from my dev box to my hosting provider??
-
Are modules reusable?
· 11 years ago
Thanks, that's very helpful. I was thinking of modular pages as any pages that have a more complex use of other pages, but it does make more sense to be using plugins.
-
Are modules reusable?
· 11 years ago
Sure this can be done. The problem lies in the fact that it can be done in many ways. Grav really doesn't have the concept of a modular in the Joomla/WordPress way of things. There are no positions
-
Are modules reusable?
· 11 years ago
Hi there, We're just looking into Grav, and from what we've seen we love it. However, to make a business case for it we've got a couple of questions that need answering. The first is, is there a way t