Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Paul Massendari Regular
Grav Forum Moderators
@paul · Joined 9 years ago · 143 posts · 0 topics · 53 reputation
Badges
Recent posts
-
Blueprints for specific template children item
· 8 years ago
Your best bet would be to indeed change the template on every subpage. However, I think it is possible, and the only solution I can see, but it is quite advanced and kind of a hack, is to use the cond
-
Page Objects & YAML Front Matter
· 8 years ago
as you are in a for loop, you have to use the variable you defined, in this case post. Example: {% for post in page.children %} {{post.title }} {{ post.header.author }} {{ post.media.images|first }} {
-
Non-technical end users
· 8 years ago
Hi Utis, What you are looking for is totally doable, you can add some buttons in order for your user to only click a button if they want to create a blog post. In this example, I made a button to add
-
How to dynamically access images from upload field from an images folder inside of theme?
· 8 years ago
Does this work ?: {% set this_year = "now"|date('Y-m-d') %} {% for feature in page.find('/events').children.order('feature.header.overview.datestart', 'desc') if feature.header.overview.datestart &g
-
Formatting date ranges
· 8 years ago
you're welcome. You could ask for others opinions, but I think it could be useful to add these options to the datetime in order to do that with the blueprint.
-
How to dynamically access images from upload field from an images folder inside of theme?
· 8 years ago
yes, it's not page.media but should be feature.media. Made the mistake in my example. will edit
-
How to dynamically access images from upload field from an images folder inside of theme?
· 8 years ago
Here is the correct version: {% for feature in page.find('/events').children() %} {% set image = feature.header.overview.homepage_img %} {{ image|first.size }} << output correctly
-
Formatting date ranges
· 8 years ago
Here is an example: In your blueprint, add an id to your datetime field. Then you can set a date with <script type="text/javascript"> $(function () { $('#theidfromyou
-
How to dynamically access images from upload field from an images folder inside of theme?
· 8 years ago
hi @horussky The answer is in the cookbook, but let me explain. When using file fields, don't forget that the file field allows for multiple images to be uploaded, it therefore create an array of imag
-
How to dynamically access images from upload field from an images folder inside of theme?
· 8 years ago
Take a look at this cookbook entry: https://learn.getgrav.org/cookbook/twig-recipes#displaying-an-image-uploaded-in-a-file-field Example: {{ page.media[header.yourfilefield|first.name] }}