Most Popular

1500 questions
105
votes
8 answers

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 distributed database setup, and I believe the Craft…
Eric Ressler
  • 1,149
  • 2
  • 9
  • 15
71
votes
12 answers

Getting this SQL Error: GROUP BY incompatible with sql_mode=only_full_group_by

I am getting the following error: Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #18 of SELECT list is not in GROUP BY clause and contains nonaggregated …
user3818623
  • 877
  • 1
  • 7
  • 7
61
votes
1 answer

How secure is Craft and why is it secure?

What measures have been put in place in regards to securing Craft at the core level. What measures have been put in place in regards to Craft's Plugins which make use of (connect to if you will) Craft's core? If possible (without an opinion piece…
Natetronn
  • 1,375
  • 2
  • 12
  • 20
41
votes
2 answers

What are the best practices for using the {% cache %} tag?

I started using the {% cache %} tag and would like to know what the best practices are: . Regarding performance: For example does it make sense.. ..to cache the whole template, or is it better to enclose each query separately? ..to combine the…
Victor
  • 8,376
  • 1
  • 34
  • 61
39
votes
3 answers

How to link to previous/next entries in a section?

What would be the equivalent in Craft of ExpressionEngine's Next/Previous entry linking? I was looking at getNext() and getPrev() (and their aliases next and prev) (via the EntryModel docs), but when I try the obvious:
38
votes
5 answers

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". [ {% for entry in…
Bill Criswell
  • 962
  • 1
  • 10
  • 14
38
votes
3 answers

Reset password with MySQL

Is there a way to reset an admin account's password by modifying the MySQL directly? I've found the craft_users table where the hashed password is stored but I don't know how to hash a string so that it will be read correctly by Craft.
bravokiloecho
  • 1,583
  • 4
  • 17
  • 22
37
votes
4 answers

What is the current landscape regarding e-commerce plugins for Craft?

I'm developing an online store. The store needs to be seamlessly integrated with all of the editorial content on both the front and back-end. Craft is obviously a perfect candidate for the editorial content, but at this moment the options for…
Mike Pierce
  • 604
  • 6
  • 15
35
votes
11 answers

How can I add a dynamic "active" CSS class to the navigation on any given page?

Just wondering how people approach setting a class of current in their navigation. Is there anything in Craft or Twig where you can set a conditional to check if a page is the current page. Or do you just need to set classes/ids on the body tag…
Gareth
  • 1,605
  • 2
  • 14
  • 35
34
votes
1 answer

What’s the recommended way to set the site URL?

There are multiple ways to set the site URL. What is the recommended way?
Brandon Kelly
  • 34,307
  • 2
  • 71
  • 137
34
votes
3 answers

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. Commit production file system changes via git. Choose…
Matt Stein
  • 4,006
  • 3
  • 26
  • 57
32
votes
1 answer

Is there a way I can programmatically download the latest version of Craft?

If you have a base install script that you use to quickly turn out a new base install for Craft, it would be very useful for that script to be able to download the latest version of Craft when doing it’s new site setup logic. What’s the best way to…
Brad Bell
  • 67,440
  • 6
  • 73
  • 143
31
votes
2 answers

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 run Craft updates in my dev environment, version…
Alex Kendrick
  • 995
  • 9
  • 24
30
votes
4 answers

Test for empty field?

How do I check if a field is blank? I thought it was something like {% if article.articleImage is defined %} Which in this case is testing an Assets field (and seems to work). Tried the same for a text field (in a Matrix row), and that doesn't…
pumkincreative
  • 761
  • 2
  • 7
  • 15
29
votes
3 answers

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 have this build on an EC2 instance and so far it…
Carlo Laitano
  • 411
  • 4
  • 4
1
2 3
99 100