Matt Wilcox
  • Member for 7 years, 6 months
  • Last seen more than a month ago
1 answers
3 votes
163 views
What do some Craft permissions mean?
Accepted answer
2 votes

Access the site when the system is off means that a logged in user with that permission can view the website front end (I think - never actually used this). You can set the system status in Settings > ...

View answer
2 answers
1 votes
8k views
Where can I download example templates?
2 votes

You won't find downloadable templates like you're used to in other CMS's because the philosophy of Craft isn't about downloading theme's. You should be building your own: https://craftcms.com/docs/...

View answer
2 answers
2 votes
336 views
Charge plugin redirecting to page with "1" on it
2 votes

I have seen this before - yesterday in fact, with this plugin. But I was messing about trying to get it to report errors back to the calling template from a plugin I was writing. I still don't know ...

View answer
1 answers
0 votes
134 views
Category archive page isn't filtering by current category
2 votes

Mystery solved; the relation code was too general; some of the entries were related to the category on the homepage, and the example code doesn't care about how or where the entries are related to the ...

View answer
5 answers
2 votes
5k views
How to improve unexpectedly poor Craft performance?
Accepted answer
2 votes

Thanks all. In summary: Craft 1/2 (based on Yii 1) just isn't very efficient, and beyond using the {% cache %} tags there's very little to be done which can make Craft itself faster. Time to first ...

View answer
1 answers
0 votes
86 views
Can you beta build a Craft site in the www directory while the current site is still running?
Accepted answer
2 votes

In general, developing a website on the live server is a risky thing. Should something go wrong while you're developing then you risk the live website. It's unlikely, but an accidental upload to the ...

View answer
3 answers
1 votes
363 views
How do I pass dynamic year and month to the .after() and .before() functions?
2 votes

I've worked around this as follows: {% if month is not defined %} {% set before = year+1 %} {% set after = year %} {% else %} {% if month == 12 %} {% set yearBefore = year + 1 %} ...

View answer
3 answers
1 votes
145 views
Stop specific Twig template from rendering anything
1 votes

{% if not currentUser %}{# or whatever #} {% exit 401 %}{# Or whatever HTTP status appropriate template it should be #} {% endif %} ... the rest of your template ...

View answer
1 answers
1 votes
100 views
Why is this Twig code generating large numbers of DB queries?
1 votes

The solution is below. EDIT: only for MySQL 5.7.4 and lower! Higher versions break. For whatever reason, the mechanics of the group filter in this case was producing a new query for every Entry. ...

View answer
2 answers
1 votes
95 views
Doing something with the success response from a Webhook
Accepted answer
1 votes

Turns out this was not a good use case for the Webhooks plugin - which is better suited to blind "shout outs" to other services than "communication" with them. I created a plugin instead that uses ...

View answer
1 answers
1 votes
49 views
Why Does Manual Cache Clear Work But CP Task Fails?
1 votes

It's a fairly common problem: https://craftcms.com/guides/resolving-stalled-background-tasks

View answer
1 answers
1 votes
33 views
How to filter relational field types on their related content's status?
Accepted answer
1 votes

My assumption that the query was not getting all the related entries from withing the Matrix was wrong. The filtering that happens is applied at output level, and not the query level. The solution is ...

View answer
2 answers
1 votes
464 views
How do you show which Sale a product has applied in Commerce?
1 votes

Thanks to Mike Pepper on the Slack chat, this is the answer. A bit disappointing that we need to go through hoops like this, but it works. {% set productSales = [] %} {% set allSales = craft....

View answer
3 answers
2 votes
825 views
Images uploaded or static
1 votes

For me, it usually breaks down like this: Static assets are unrelated to the content of the website. They are design related. Dynamic assets are content. They have meaning. /craft /public /assets (...

View answer
2 answers
1 votes
493 views
Control Panel Session 60 second Timeout
1 votes

I've had issues before where I was getting logged out and could not fathom why: it turned out (after weeks) that when I was using Inspector Tools' Responsive Design mode, Chrome sends different UA ...

View answer
3 answers
1 votes
88 views
Placid plugin - limit returned results
1 votes

Not a true answer, but a work around: {% for tweet in timeline.data %} {% if loop.index <= 5 %} ... {% endif %} {% endfor %}

View answer
2 answers
1 votes
173 views
Live Preview fails to load
1 votes

Also; in case this is part of your issue - the .htaccess file is a system file (starts with a dot) and will be hidden by default in your file browser. You either need to google how to show hidden ...

View answer
2 answers
1 votes
262 views
Impersonating a User from a plugin, with specific page redirect
Accepted answer
1 votes

AGH: my problem was only that the redirect value I was passing was incomplete, which caused the template I was redirecting to to itself redirect elsewhere. Complete solution: <form action="" ...

View answer
1 answers
1 votes
94 views
Duplicating shipping details from an Order into a Cart
Accepted answer
1 votes

Simple error on my part. You don't pass the old order's "shippingMethod" model to the new cart's 'setShippingMethod' function. You pass the old order's shippingMethodHandle to the setShippingMethod ...

View answer
1 answers
0 votes
36 views
Form action updates multiple User fields, but front-end template "caches" one field?
Accepted answer
1 votes

Although submitting the form causes the same page to be loaded again, it turns out that Craft isn't actually re-parsing the loaded page. You have to tell it to do so. So, if the plugin was successful ...

View answer
2 answers
1 votes
60 views
Frontend form database error with empty Users field
1 votes

Yep, seen this before. You can't just have an empty value like that because the validation stuff just sees it as a missing field that's required to not be missing. We got around it by adding the n/a ...

View answer
2 answers
2 votes
412 views
How to update from a very old version of Craft?
1 votes

It should just work - but I've had a few instances where the automatic one wouldn't work and had to go manual. We had one which simply wouldn't work at all - that was a 2.2 to 2.6 upgrade, and it ...

View answer
2 answers
3 votes
526 views
How to persist locale in site navigation?
Accepted answer
1 votes

I found the problem. We use 'en' and 'gb' in the website's URLs (http://website.dev/en/whatever and http://website.dev/cy/whatever), and I'd mis-understood what Craft was looking for in the /craft/...

View answer
3 answers
0 votes
351 views
Craft 3 not running on Ubuntu 18.04
Accepted answer
0 votes

The problem turned out to be a missing vitally important step in the set-up of Apache. By default a fresh install of Ubuntu 18.04 has the following: <Directory /var/www> AllowOveride None &...

View answer
1 answers
1 votes
1k views
How do I use a Twig template to generate Email content from inside a plugin I'm making?
Accepted answer
0 votes

Thanks to Brad for providing the bulk of the answer. In more detail the line needing to be changed was this: $notificationEmail -> htmlBody = craft()->templates->render('PLUGIN-FOLDER-NAME/...

View answer
4 answers
4 votes
3k views
Is it possible to compress image transforms?
0 votes

Double check that the page speed reports are not flagging the images because you're rendering them at a smaller size than their natural pixel size. I believe it give a very similar message if you do. ...

View answer
2 answers
1 votes
423 views
ContactForm – How to make fields required
0 votes

There isn't a way (as far as I am aware) to make fields required from within your template or the plugin UI. The suggestion above fails as soon as JS is disabled and no JS solution should be relied on ...

View answer
1 answers
0 votes
191 views
Guest Entries ignores redirect field?
Accepted answer
0 votes

Answer: As Brad guessed; the problem was a plugin, specifically Sprout Invisible Captcha. Disabling that allowed the form redirect to work properly again.

View answer
1 answers
0 votes
294 views
Craft 3: Cache element query or variable assignment
-1 votes

The request makes sense, but I thought that Craft did some magic to make sure that a duplicate query/variable-assignment wasn't an issue by re-using the query internally. I have no idea why I think ...

View answer
1
2