André Elvan
  • Member for 7 years, 7 months
  • Last seen this week
Querying media asset in module
Accepted answer
1 votes

You can access the field in the entry by using the normal array syntax, $entry[$fieldHandle]. Depending on whether or not the field is eager-loaded, this will now be either an ElementQuery, which you ...

View answer
Product Search - redactor description field not indexing
Accepted answer
1 votes

This is the expected behaviour. To say that the native search in Craft has support for plurals, is a stretch. What the search options indicate is whether or not to allow for extra characters to the ...

View answer
Only allow SVG as file type
Accepted answer
4 votes

You can achieve this using the extraFileKinds config setting like this: 'extraFileKinds' => [ 'svg' => [ 'label' => 'SVG', 'extensions' => ['svg'], ], ], On your ...

View answer
Pass aspect ratio as variable into imager
Accepted answer
2 votes

Your variable assignment is wrong. {% set customRatio == 1/1 %} should be {% set customRatio = 1/1 %}.

View answer
Can I use GraphicsMagick with Craft CMS?
1 votes

No, Craft only supports GD and Imagick, not Gmagick (which would be the PHP extension that interfaces with GraphicsMagick). The underlying PHP library, Imagine, actually does, so I guess it would be ...

View answer
Craft Equivelent of EE addon CE Image Bulk Tag?
Accepted answer
1 votes

You can do the same thing using the Retcon plugin for Craft. Have a look at the wiki entry for the transform filter for more details.

View answer
Imager Transforms, Cacheing and S3
Accepted answer
1 votes

Imager will always create and store the transformed images locally in your imagerSystemPath, even if you choose to upload and serve them from an external storage. The files in that folder acts as the ...

View answer
Apply imageTransform on twitter media feed
Accepted answer
2 votes

Craft's built-in transform functionality doesn't support transforming external URLs. You could use my Imager plugin to do this instead. EDIT: Based on your example, you'd use Imager something like ...

View answer
Uploading assets to different locations based on environment
1 votes

AFAIK, you can't change the type of your volume based on your environment. But if having a separate S3 account/bucket for dev could work for you, you can configure this with a volume.php config file. ...

View answer
.limit(1) on asset field loop is effecting another loop on same page
Accepted answer
1 votes

Yes, this is actually the intended behaviour, and one that changed when going from Craft 2 to Craft 3. You can read more about it in the Changes in Craft 3 article in the docs. projectImages in this ...

View answer
How to make PNGs crisp using Imager + Optipng and Craft 3?
Accepted answer
3 votes

Unfortunately, resizing images always tends to make them a little bit blurry, especially if the size that it's resized from isn't very big. But, here's a few things you can try: Make sure you're ...

View answer
Eager load Imager transforms in Craft Commerce
Accepted answer
3 votes

Eager loading is used to reduce the number of database queries. Imager doesn't store any data in the database, it's completely file-based, so it's not relevant to use eager-loading in relation to it.

View answer
Cache and Pagination not working
3 votes

Based on the code you posted on pastebin, it seems like the problem is that you have your pagination outside of the cache tags (assuming this was the case when you had caching implemented). And, I'm ...

View answer
Twig function to load templates into variable?
Accepted answer
3 votes

You can't do it exactly like that in Twig. But there're different approaches that'd do the same thing depending on exactly what you're trying to achieve. For instance, you could parse the template ...

View answer
How to return data to an ajax succes callback
Accepted answer
2 votes

As Robin mentions, your controller needs to return an object of type Response, and in your case you probably want to return it with the format set to json. There's a helper method in Craft's ...

View answer
Structure entry position in url
Accepted answer
0 votes

If your structure only has one level, you can use a title format like this: Number {{ craft.entries.order('lft desc').positionedBefore(object).total()+1 }} published in {postDate|date('F')} {postDate|...

View answer
Redactor plugin not found: imagePosition Craft 3
Accepted answer
2 votes

The reason you get the error is probably that you had the Redactor Image Position plugin installed in Craft 2. If the plugin was available for Craft 3, you'd just need to update to it. But since it's ...

View answer
Populate Field Group With Fields From Another Field Group
2 votes

No, there's nothing built into Craft that lets you do this. Please note though, that you can reuse fields across sections in Craft. Field groups is just an organizational layer on top of fields to ...

View answer
How to compare currentUser with entry.author?
Accepted answer
2 votes

Try this: {% if currentUser.id == entry.author.id %} When using quotation marks, it means that it's a string in Twig. What you want to do is compare the value of the actual variable. Also, ...

View answer
Setting Imager crop position dynamically
2 votes

If the value of imageCrop is a string in the correct format (ie 50% 50%, 0% 0%, or similar), this should do it: {% set entryImage = entry.pageHeader.first() %} {% set imageCrop = entryImage....

View answer
How to use `{% cache %}` and `{% paginate %}` together?
1 votes

Yes, the database query you'd want to cache is this: {% paginate craft.entries.section('employment').endDate('>= ' ~ now).limit(10) as pageInfo, pageEntries %} So to get the benefits of caching, ...

View answer
Matrix gallery with Imager plugin
Accepted answer
2 votes

Assuming it's the field portfolioImage that can have multiple assets, try this: {% for block in entry.portfolio %} {% switch block.type %} {% case "images" %} {% for image in block....

View answer
Most related articles
3 votes

If you're only trying to find related articles based on elements (ie tags, categories, entries, etc), you can use my Similar plugin. Here's a basic example, more info in the repo: {% set ...

View answer
How to implement mailchimp plugin to target different mailists?
1 votes

If the plugin in question is my MailChimp Subscribe plugin, you can easily target different lists by adding a hidden field called lid to your form with your list ID: <input type="hidden" name="lid"...

View answer
Duplicate Entry Types into a new section
3 votes

You need to use a plugin to do this. I've used the architect for doing exactly this in the past. Just export the section and entry types you want to duplicate, rename the section in the json file, ...

View answer
How to create a Modal with a scrollbar
3 votes

Although I agree to close this, I think Anubarak deserves an answer as to why this is not Craft related. The Garnish Modal doesn't care what you use it for, it's just a modal. So, what Daryl and Mats ...

View answer
Craft Commerce View Order PDF, Not Download
Accepted answer
3 votes

No, I don't think there's a way of having a "live" pdf open, in the same way as a webpage. But, what I usually do is just open the pdf template directly in the browser and create the HTML and CSS ...

View answer
pagination showing all entries
Accepted answer
2 votes

When you use {% paginate %}, the second variable that's returned, pageEntries, is the paginated entries. When you do craft.entries.section('news').featured('not 1') later in the template, you're ...

View answer
Category conditionals
Accepted answer
3 votes

The category field returns an ElementCriteriaModel, which means you can use all the methods that you'd usually use to get a specific category on it. For instance, if the category field is named ...

View answer
Display children's order numbers
Accepted answer
1 votes

If you're getting all the descendants in the for loop, you can use loop to get the index of the current iteration: {% for chapter in entry.descendants %} <div class="part"><span>Part {...

View answer
1
2 3 4 5