Matt Stein
Moderator
  • Member for 7 years, 7 months
  • Last seen this week
Deploying Craft on AWS
27 votes

The trouble is, there's no one way to utilize AWS. You can set up a simple VPS, or get endlessly complicated with load-balancing multiple servers, adding CDN, utilizing cool caching options, and ...

View answer
How do you create a front-end form for users to submit content?
Accepted answer
19 votes

If the users are authenticated and have permission to post to the event section, you would use an entry form to accept posts from the front end. Example from the above linked page... <form method=...

View answer
How can I create a visually weighted tag cloud?
Accepted answer
15 votes

Brandon commented on getting tag usage count (and how it can be expensive) in this Google+ post and again in this SE question where I was trying to think through a plugin. So to completely steal from ...

View answer
What is the current landscape regarding e-commerce plugins for Craft?
15 votes

I just finished my first Snipcart project and I'm in the process of making a plugin for browsing orders and customers from the Craft control panel. Lindsey D's got the landscape covered with his ...

View answer
How can I create a visually weighted tag cloud?
14 votes

Marion Newlevant had a clever, efficient idea in this Straight Up Craft Hangout if you don't mind having a slight lag (like a day) for your tag counts to be up to date. That idea: store the counts you ...

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

Barrel Strength also have a URL segment based plugin called Sprout Active, with docs/examples here.

View answer
How do I import data into Craft?
11 votes

As far as ExpressionEngine goes, it looks like Mark Reeves has cooked up a starter plugin for that purpose. Bob Olde Hampsink made an import plugin as well that works with CSV's.

View answer
How can I utilize existing UI for my plugin's control panel views?
Accepted answer
10 votes

Have a look in craft/app/templates for tons of great, easily-reusable examples that make up the existing control panel! They may not be documented, but there's a whole lot of quality stuff there. You ...

View answer
How do I add an HTML block from template extension to main layout template? (i.e. meta data)
Accepted answer
7 votes

Option A: Set individual properties in the child template If you want to set specific meta properties instead of defining a block, you can include lines like this in _layout.html: {% if ...

View answer
Order Assets by date field
Accepted answer
7 votes

You're so close it's maddening—you should be able to order by a custom field as well: {% set assets = craft.assets.find({sourceId: 2, order: 'date desc'}) %} Where date is the name of your custom ...

View answer
Comprehensive logging of user actions with Craft Pro?
Accepted answer
7 votes

I don't know of a plugin that exists expressly for this purpose, but you could combine LumberJack (logging plugin) with Craft's numerous events to make this happen with your own plugin. You can log ...

View answer
Smart quotes in rich text fields?
Accepted answer
6 votes

It turns out Smartdown should do the trick. It's a Craft plugin that adds MarkdownExtra and SmartyPants (the latter of which matters here) support to Twig. SmartyPants is a rather ancient blogging ...

View answer
Parse a line of Markdown, without <p>
Accepted answer
5 votes

If you're here looking for a Craft 3 answer, the Wordsmith plugin offers the same ability to only parse inline and not include paragraph tags: {{ entry.title|markdown(inlineOnly=true) }}

View answer
Multiple image transforms of same image in template
Accepted answer
5 votes

You might consider setting a variable for the image, then one for each transform type. {% set thumb = { mode: 'crop', width: 300, height: 300 } %} {% set large = { width: 600 } %} {% for photo in ...

View answer
Migrating my Blogger site to CraftCMS
4 votes

I migrated a Blogger site by writing a Craft plugin to parse Blogger's XML and save images, posts, and categories into the Craft setup established with the client. The challenge with Craft is that ...

View answer
Entry versioning history only shows last 10 versions
4 votes

I don't think Craft has any other place for viewing old entry versions. You can browse the entire set by examining a table in the database, or write a plugin to display all of them. Quick and Dirty ...

View answer
Unable to create the cache directory
Accepted answer
4 votes

Yes, Craft still has its runtime caches for compiling Twig templates (as seen in your example) and such. Craft's template and partial cache is separate from Twig's own template compilation, if I'm not ...

View answer
Why would an if statement insist on printing a value?
Accepted answer
4 votes

Wow Matt, awful question! You should probably have a moderator remove it so nobody else has to suffer. In SproutForms_HtmlDisplay, change the __call() function's echo... public function __call($key, ...

View answer
First steps with Craft Nitro: hostname not working after successful install
3 votes

After cheating via discussion in the comments, I’m certain that your DB_SERVER is incorrectly set to 127.0.0.1 when it should in fact be mysql-5.6-3306.database.nitro. In a perfect world this would ...

View answer
Recommended hosting company for a Craft site?
3 votes

I use... RamNode and Virtualmin GPL for fast, powerful, inexpensive development boxes that take minimal maintenance/sysadmin time (check out Virtualmin GPL's super-easy install script!) Webfaction ...

View answer
How can I submit a form from a Garnish HUD footer?
Accepted answer
3 votes

Since the shuffled markup is the root of the problem, one might follow examples from the Craft control panel source that serialize the form's data and submit via AJAX (and often $.proxy() to help with ...

View answer
Can't include relative JS file from layout
Accepted answer
3 votes

It looks like this is all happening in Craft's template folder, where anything with an underscore—like your _layout directory and its contents—won't be accessible via URL. You'll definitely want to ...

View answer
How do I perform a critical update if my Craft site relies on older plugins?
3 votes

I'd want the client knowingly and enthusiastically on board with a sensible plan that'd support business goals and the nature of evolving software. Either a) do with fewer plugins/integrations, b) ...

View answer
How can I notify store owners when stock levels are getting low?
3 votes

Just like Craft itself, Craft Commerce has lots of events you can have a plugin respond to. In this case, you'd want to write a plugin that waits for commerce_orders.onOrderComplete (per documentation)...

View answer
CraftCMS Documentation Site License
Accepted answer
2 votes

The project at craftcms/docs includes a proprietary theme we’ve developed for our own internal use only. You’re welcome to use our general-purpose theme behind our class reference docs, however.

View answer
Generate PDF's (Printmaker plugin) with a static header and footer
2 votes

I've not yet tested specifically with Printmaker (only Laravel + Dompdf), but you should be able to add page numbers by using a special <script> block in the template you use for PDF rendering. ...

View answer
Can we define routes (non-CP) in plugins?
2 votes

In Craft 3, you can accomplish this by hooking into the UrlManager::EVENT_REGISTER_SITE_URL_RULES event.

View answer
apply transform to image uploaded into Redactor?
2 votes

You can also use the free Retcon plugin to apply named or inline transforms at the template level, using Craft's native transforms or Imager if you have that installed as well. This isn't limited to ...

View answer
Output deprecation error
Accepted answer
2 votes

In your example, for entry in craft.entries.section('homepage') is attempting to loop through homepage entries as though they're an array. In Craft CMS 3, this is now deprecated just like the error ...

View answer
How do I delete an asset with module or plugin
Accepted answer
2 votes

I'm not sure how well it'd go with 50,000 Assets, but you should just be able to call Craft::$app->elements->deleteElement($asset) for each one, or Craft::$app->elements->deleteElementById(...

View answer