André Elvan
  • Member for 7 years, 6 months
  • Last seen this week
1 answers
1 votes
292 views
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
1 answers
1 votes
411 views
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
1 answers
1 votes
118 views
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
2 answers
2 votes
193 views
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
1 answers
1 votes
450 views
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
1 answers
2 votes
356 views
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
1 answers
1 votes
171 views
How can I get all entries that are equal to, but not after a date?
Accepted answer
2 votes

I think the only issue is that you're adding "today" to the query as a string, not the variable you've created. try: {% set today = now %} {% set events = craft.commerce.products.type('event')....

View answer
1 answers
1 votes
872 views
Loop through remaining craft.entries
Accepted answer
2 votes

I think you can just add .offset(3) to the "remaining" craft.entries query to get the result that you want. Or you could exclude the id's of the first three. But, this is quite ineffective (...

View answer
2 answers
5 votes
669 views
Image transform is turning my jpegs dark
2 votes

The file probably has a color profile, which gets removed by Craft by default. You can tell Craft to preserve the color profile by setting the preserveImageColorProfiles in your config file. '...

View answer
1 answers
1 votes
135 views
Formerly - Checking if e-mail already entered
Accepted answer
2 votes

(this is more of a jquery question than Craft, but...:)) The reason this doesn't work is because $.post works asynchronously (that's the A in AJAX). It creates a request, with a success handler (the ...

View answer
2 answers
4 votes
332 views
Is it possible to order related entries by relevance of tags?
2 votes

I've made a plugin called Similar that does exactly this. Give it a go.

View answer
2 answers
3 votes
636 views
Target a certain entry type on the entries fieldtype
Accepted answer
2 votes

This is not possible by default in Craft. Check out the Entries Subset plugin, though, I think it can do what you want.

View answer
1 answers
0 votes
182 views
How do I grab the label of a LJ Dynamic dropdown fields
Accepted answer
2 votes

The LJ Dynamic fieldtype only stores the value as a string, or as an array of values for the multiselect fieldtypes. The label in the settings is there just for displaying in the admin. Either you ...

View answer
1 answers
1 votes
142 views
How to pass Calendar ID to include
Accepted answer
2 votes

Two things, the variable you send in is called calendarId, not id. Also, inside twig code (like the set function), you don't use twig tags, just the variables directly. Try to change the params object ...

View answer
3 answers
2 votes
1k views
Detect device screen size in craft cms
2 votes

As Alec says, the server doesn't know details about the users screen, that has to be fetched with javascript client-side. But the information can be exchanged through a cookie so that the server can ...

View answer
1 answers
4 votes
262 views
How to handle mock / placeholder assets in a pattern library?
Accepted answer
2 votes

Two ideas come to mind. First, it would be a lot easier to check if an image exists if you send in null in the include instead of an url to the placeholder image, and then let the cart template know ...

View answer
2 answers
2 votes
319 views
Plugin variables class versus twig functions/filters class
2 votes

I'd say; use twig functions/filters when the data you want to operate on comes from your template, plugin variables when you need to operate on data from your plugin/another source. You can, to my ...

View answer
1 answers
1 votes
1k views
How to set cookie and redirect to page one time
Accepted answer
2 votes

Try this: {% if currentUser %} {% set name = currentUser.firstName %} {% if craft.lj_cookies.get('account') != name %} {% do craft.lj_cookies.set('account', name) %} {% ...

View answer
1 answers
4 votes
1k views
Retrieving an entry by ID in ALL locales
Accepted answer
2 votes

I don't think this is possible witout the use of a plugin. The craft.entries tag works on an entry basis. The slug is saved in the table that houses the localized data for an element, ...

View answer
2 answers
3 votes
101 views
Are values in Asset fields held globally for a particular Asset?
Accepted answer
2 votes

The fields attached to an asset source will be connected to the asset, and will follow the asset no matter where it's used. So yes, this is the intended behavior. If you need to specify on an entry ...

View answer
2 answers
1 votes
198 views
Targeting entries in a structure
2 votes

To get a specific entry you need to know the id or slug of the entry. If the slug for Chicago is "chicago" (you find the slug in the side panel of the entry edit screen), you can get it like this: {% ...

View answer
1 answers
1 votes
551 views
Current Entry Children Count
Accepted answer
2 votes

Try this: {{ entry.getChildren().total() }}

View answer
1 answers
1 votes
115 views
Does the default local content show when you toggle another locale/s off?
Accepted answer
2 votes

If you toggle off a locale for an entry, that entry will not show in that locale. So, if you have a section news, toggle off the entry my-entry in your current locale, and use craft.entries.section('...

View answer
1 answers
1 votes
195 views
How to use sprite sheets effectively and responsively in Craft
2 votes

I thought I'd just add my two cents, since no one has answered this yet. :) It's not clear from your question if these image elements are purely front-end design assets, or if the client/end-user ...

View answer
2 answers
2 votes
698 views
How to set a different URL format for each entry type of a section?
2 votes

You can't create a separate url format for each type, the url format is defined on a per section basis. But you can use the type as part of the url, if that helps. For instance, you can set the url ...

View answer
1 answers
1 votes
74 views
Method for pulling entries that have a specific image linked?
Accepted answer
2 votes

You can use relatedTo for that: {% set entries = craft.entries.section('mySection').relatedTo(myAsset) %} Or {% set entries = craft.entries({ section: 'mySection', relatedTo: myAsset }) %} Check ...

View answer
2 answers
2 votes
668 views
How to only show translated fields in an additional locale?
Accepted answer
2 votes

The fields that are not marked for translation are duplicated and synced between the different locales. So if you make a change in one locale, it will change it in all. This is different from saying ...

View answer
1 answers
2 votes
929 views
Return the current section type? (plugin)
Accepted answer
2 votes

The SectionModel has a type property, which return what you're after, "single", "channel" and "entry". In a template it can be accessed like this: {{ entry.section.type }} If this is in a plugin and ...

View answer
1 answers
2 votes
26 views
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
2 answers
1 votes
26 views
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