All Questions
14,269
questions
15
votes
1
answer
1k
views
How do you sort elements queried from multiple channels?
This is how I query elements from multiple channels:
{% set allEntries = craft.entries.section(['publication','text', 'exhibition']).limit(null) %}
I now want to sort all these entries by a custom ...
7
votes
1
answer
769
views
How can I use operators within Twig hashes?
I'm looking for documentation on how to use operators in hashes in Twig. Someone mentioned this in the Google+ support group the other day and I was unable to find any docs or examples.
{% set ...
25
votes
9
answers
9k
views
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....
6
votes
2
answers
2k
views
Using auto-generated titles against entry field type values
How would you setup a section's entry type to auto-generate the titles based on the title (or slug) of another entry?
For example, we have a Software section with entries. We also have a Releases ...
11
votes
2
answers
1k
views
Search matrix for blocks with upcoming dates
I have a matrix field with one "event" block type that contains several fields. One of those fields is a date field. Is there a way to get just blocks with upcoming dates?
9
votes
2
answers
862
views
How can I run the Control Panel from a separate domain?
Is it possible to separate the public site and the Control Panel on separate domains (i.e. www.domain.com and admin.domain.com)?
With baseCpUrl you're able to force the admin URL to admin.domain.com, ...
18
votes
1
answer
7k
views
How do you create a front-end form for users to submit content?
I'd like to create a form for users to load events (that I will moderate and publish).
How do I do this?
9
votes
3
answers
2k
views
What accurately will set asset paths for multilingual sites?
This is actually a fairly crucial matter, since relative paths definitely won't work with languages, unless you really want all assets in a given Source to be localized or at least copied to each ...
31
votes
2
answers
2k
views
How can I prevent my client from auto-updating Craft in production?
How can I prevent my client from auto-updating Craft in production? I don't want them to run Craft updates on the production site, but the "updates" badge seems irresistible to them. I would prefer to ...
38
votes
5
answers
12k
views
How can I retrieve channel data in json format?
I've played around with a few implementations but I still don't feel like either is right.
I first came across building the JSON itself. This would be in a file at "craft/templates/entries.json".
[
...
20
votes
3
answers
17k
views
How can I check on the value of a template variable?
If I'm used to PHP's var_dump() and print_r() to check the value of a variable, how can I evolve to inspect things in Craft where Twig's dump isn't available?
9
votes
2
answers
1k
views
Is it possible to output the name of a Matrix Block?
I'd like to output the Names of Matrix Blocks. I know you can filter by block types e.g.
{% for block in entry.myMatrixField.type('text, heading') %}
{% if block.type == "heading" %}
<h3>{{ ...
34
votes
3
answers
3k
views
What's the best practice for upgrading a versioned Craft site?
It's thrilling to click The Button and watch Craft update itself. I take advantage of multi-site configurations with every deploy, and my practice thus far is to...
Upgrade Craft in production.
...
19
votes
4
answers
5k
views
Can I run one Craft install on multiple domains and/or subdomains?
Is it possible to have one Craft install running multiple domains and/or subdomains?
For example having the same Craft install running a blog Channel at blog.example.com and also an about Single at ...
104
votes
8
answers
15k
views
What's the best practice for handling data migration and organization across development environments?
This issue becomes especially difficult when there are multiple environments, with multiple developers working on different features that affect the data structure.
The holy grail is a git-style ...
22
votes
4
answers
8k
views
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.
17
votes
1
answer
8k
views
How do you list categories in a category group?
I would like to output a list of all the categories in a category group on the front end. How do I do that?
29
votes
3
answers
2k
views
How do I configure Varnish to work with Craft?
Has anyone successfully used Varnish with a Craft build? I'm trying to set up Varnish on my server but I'm very new at this. Can anyone share their config file or point me in the right direction? We ...
20
votes
1
answer
438
views
Transform Info from Handle?
Can I extract a transform's settings from its handle? I'm trying to avoid upscaling images using the workaround, and I'd like to set my transform handle dynamically within some conditionals. (see this ...