Most Popular
1500 questions
28
votes
2 answers
How safe is auto-updating?
I have auto-updating currently disabled using the "allowAutoUpdates" config setting, due to concerns about plugin compatibility and unforeseen breakages, mainly due to experiences with other CMS's.
However, I'm starting to feel that having that…
Alex H
- 945
- 1
- 8
- 17
27
votes
2 answers
What are the most common template performance gotchas to avoid?
I'm coming to Craft as someone experienced with Expression Engine templates. When I'm coding for EE I try to avoid certain big ticket performance hits, for example:
Using embeds excessively.
Using the disable parameter.
Using simple conditionals vs.…
mjr
- 1,405
- 13
- 21
25
votes
9 answers
How can I build a language switcher?
I'm currently building a site with two languages, and I need a language switcher so wherever you enter the website you can switch the language easily.
I've come this far:
{% for locale in craft.i18n.getSiteLocales() %}
KSPR
- 3,786
- 2
- 29
- 52
25
votes
1 answer
Generating pending image transforms stuck in process
In the CMS the progress indicator for tasks is stuck and not completing its jobs. What can I do to resolve this?
a-am
- 2,857
- 1
- 19
- 25
25
votes
4 answers
Access environment information in template
Is there a way to check what environment craft is running on - ie, dev or not dev - via the template.
For example:
{%if env is 'dev'%}
hello dev
{% else %}
hello world
{% endif %}
bravokiloecho
- 1,583
- 4
- 17
- 22
25
votes
4 answers
Add home page to a structure?
I am using a structure for all of my site's pages (single pages and channel index pages). The structure settings are as follows:
URL for Top-Level Entries:
{slug}
URL for Nested Entries:
{parent.uri}/{slug}
Entry…
carlcs
- 36,220
- 5
- 62
- 139
24
votes
3 answers
How can I automatically generate responsive images from a single hi-res asset?
I want to be able to upload a single high resolution image, and output a element that outputs it with a few different sizes and resolutions automatically (using Picturefill to sort out which one actually shows up to the browsers). How can…
Brandon Kelly
- 34,307
- 2
- 71
- 137
24
votes
3 answers
Differences between Craft and WordPress
This is a super high level question but it would be good to get a couple of summary answers. What are the main pros and cons of Craft versus WordPress?
Andrew Fogg
- 341
- 1
- 2
- 5
23
votes
3 answers
How can I route a specific entry in a structure section to its own template?
While setting up a site recently I wanted to route a specific entry in a structure section to its own custom template. Using a dynamic route sounded like the right option until I remembered that it wouldn't work due to Craft's routing order (matched…
Ben Croker
- 7,341
- 26
- 55
23
votes
1 answer
How can my plugin generate a generic modal window in the Control Panel?
I'm working on a plugin, and it requires a modal to be displayed when the user interacts with a field of my Field Type. When the user finishes interacting with the modal, they would click "Done".
This is the standard modal that displays when you…
Lindsey D
- 23,974
- 5
- 53
- 110
22
votes
1 answer
How does template caching work?
The {% cache %} tag is quite powerful, and can be used to greatly increase the performance of templates.
But ultimately the whole thing is still pretty mysterious. I can see three tables in the database which seem to relate to…
Lindsey D
- 23,974
- 5
- 53
- 110
22
votes
4 answers
How do I import data into Craft?
What's the best known way to import masses of data into Craft?
Are there tools that support the migration of content/users from say XML, JSON etc.
Steven Grant
- 1,855
- 13
- 27
22
votes
3 answers
How can I get only those entries with non-empty assets field
Since Craft 2.0 it is possible to pass :empty: and :notempty: to ElementCriteriaModel parameters when you’re looking for empty/non-empty values. If you are for example looking for all entries with a non-empty text field myTextField, you can do…
carlcs
- 36,220
- 5
- 62
- 139
21
votes
3 answers
413 “Request Entity Too Large” error with uploading a file
In assets when uploading a medium size file I get this error:
Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
What does it mean? And how to fix?
Johannes Lamers
- 2,022
- 1
- 19
- 34
21
votes
1 answer
Exclude Current Entry
How can I exclude the current entry when I've structured my syntax like this?
{% set entries = craft.entries({
section: 'blog',
order: 'postDate',
limit: 5,
}) %}
Niall Thompson
- 1,199
- 1
- 11
- 24