Hot answers tagged

40 votes
Accepted

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

E-commerce Master List This is a compilation of all publicly available solutions. Other answers here describe each plugin in greater detail... This is simply a complete list of every known option. ...
23 votes
Accepted

Can a plugin add JS or CSS to the control panel?

One way to accomplish this is to write some code in the init() function of your root plugin file. So in your example that might look something like: class MyFunkyPlugin extends BasePlugin { ...
user avatar
  • 2,301
18 votes

Protect a page with a single password?

I've actually done this a couple of times... a very simple "password-only" page. Then there would be a large group of people who share that same password, and can gain access to that protected page. ...
user avatar
  • 23.6k
17 votes
Accepted

How can I check if a plugin is installed and enabled?

On top of checking within the admin area, there are some other ways you can do this, both in templates and in your plugins. In a template {# Second argument is if you want enabled only #} {% set ...
user avatar
  • 4,519
16 votes

Invalid plugin: No plugin exists with the handle - Craft 3

For future reference, I had the same error and resolved it with Craft Support. In my case the project.yaml file got out of sync with what was in the database. Running craft project-config/rebuild ...
user avatar
  • 1,385
15 votes

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

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 ...
13 votes
Accepted

How do I add custom styles/plugins to the rich text editor in Craft?

If by styles you mean the formatting drop-down, just add them in an array: { buttons: ['bold', 'italic'], formatting: ['p', 'blockquote', 'h2', 'h3', 'h4', 'SomeHtmlTag'] } . If you want to ...
user avatar
  • 8,316
13 votes

Protect a page with a single password?

The easiest way I have found to password protect page content is as follows: {% if craft.request.getParam('password') == 'password_you_want' %} <h2>This is your content</h2> {% else %}...
user avatar
12 votes

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

I've yet to try it but Snipcart seems to be on of the most viable options right now. Essentially it works though HTML/JavaScript and integrates with fields you define in your Craft setup, see their ...
12 votes

Can a plugin add JS or CSS to the control panel?

Josh's answer is great if you are interested in building your own plugin. But if that's a little much for you, you're still in luck... You can use these plugins to quickly & easily add CSS and ...
user avatar
  • 23.6k
12 votes
Accepted

Two Plugins not showing in CP after pushing to staging server

Check if the plugin folders in craft/plugins are named correctly. Most local environments aren't case-sensitive, but most servers are. Valid: craft/plugins/trunchtml/ craft/plugins/import/ Invalid: ...
user avatar
  • 8,316
12 votes
Accepted

Redactor table plugin for craft

Craft ships with Redactor’s Table plugin, but you must add it to your Redactor config yourself (in craft/config/redactor/). { // ... plugins: ['table'] } To determine which config file to ...
user avatar
  • 7,238
12 votes
Accepted

How can I print the name of every template being rendered in HTML comments, when in devMode?

So this sounded like a fun problem to solve... so I wrote the Template Comments plugin that does what you want: This free plugin adds a HTML comment to demarcate {% block %}s and each Twig template ...
user avatar
11 votes

Are there any plugins for Craft 3?

Here are some. Store Hours (P&T) match input Mandrill (P&T) Entry Count Minify (9/17/2016) MN Twig Perversion (9/19/2016) Stamp (9/21/2016) Inlin (9/21/2016) Mention more in the comments, ...
11 votes
Accepted

Tasks and Steps

You can implement your entire Task with a single step if you want. The only point of breaking it into multiple steps is so the task progress bar has an idea of how far along the task is. In your case,...
user avatar
10 votes
Accepted

getPost() on array element in plugin

You can use dot notation: craft()->request->getPost('fields.notes');
user avatar
  • 1,623
10 votes
Accepted

Triggering the start of a task from a CRON job

Everything you need to manage tasks is in the TasksService, so you should be able to just use that in your controller action to kick off any pending tasks, using something along the lines of: if (!...
user avatar
  • 4,361
10 votes
Accepted

Plugin settings - file field upload location

Unfortunately, a simple HTML file input on its own isn't enough to upload an image (in Craft or anywhere else) – the input simply exposes the file on your local filesystem to the browser/server. In ...
user avatar
9 votes

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

Foxycart indicates they are jumping in https://twitter.com/foxycart/status/478952251239567361
9 votes

How do I add custom styles/plugins to the rich text editor in Craft?

It's worth noting that as of Craft 2.5, it's now using Redactor II, so the above code examples don't work if you have upgraded. Here's a working JSON config example you can build on: { "buttons": ...
user avatar
  • 403
9 votes
Accepted

how to uninstall a plugin when there is no cp option

It isn't possible to uninstall a disabled plugin; you'll need to first enable the plugin, and then the Uninstall option will be available. The correct way to remove a plugin is actually to first ...
user avatar
8 votes

Is there a native function or plugin to allow admins to email all users?

Currently there isn't a native function to do this. The only plugin that I know of that can do this, is Sprout Email from Barrel Strength Design. EDIT: I just released a plugin called Craft-Mailer ...
user avatar
  • 8,316
8 votes

How do I add custom styles/plugins to the rich text editor in Craft?

Victor answers my questions regarding the formatting tags and the fact that you need to create a Craft plugin to add Redactor plugins. Since there wasn't a solution for adding classes on inline ...
user avatar
  • 7,238
8 votes
Accepted

Is there a very very basic example of simply outputting PHP with a plugin to Twig?

Have a look at plugin template variables. You can simply create a method in your plugins variable file that returns anything you want to the template, which would be accessible via {{ craft.myplugin....
user avatar
8 votes
Accepted

Get related entries in plugin via Entries field type

First, you should get all the Merchant Entries with the merchantId of 123 $criteria = craft()->elements->getCriteria(ElementType::Entry); $criteria->section('merchants'); $criteria->...
user avatar
8 votes

Templating SuperTable

There's no block types with SuperTable, so no need to check that. Other that that it works just the same as Matrix fields. {% for row in superTableField %} {{ row.textFieldInSuperTableField }} {% ...
user avatar
  • 35.8k
8 votes
Accepted

Cannot declare class because the name is already in use

At this point, after much playing around it seems to be working (at least on to the next bit of debugging). To sum up, it was mostly changes to composer.json, followed by composer remove kr37/...
user avatar
  • 1,263
7 votes
Accepted

Is there a native function or plugin to allow admins to email all users?

Natively, there is no direct way to do this. It is possible, however, to easily create this functionality with a plugin... Build an ElementCriteriaModel which will return a list of all users. ...
user avatar
  • 23.6k
7 votes
Accepted

Multiple actions in a form?

It’s not possible for a form to simultaneously invoke two controller actions. You would need to write a plugin that provides its own controller, which in turn could be used to invoke the other ...
user avatar
7 votes
Accepted

Are there any intentions to release multisite support for Craft?

Currently multi-site support isn't planned. If you want simple multi-site-support you could use the localization feature with a custom locale. But with Craft's auto-update's and easy deployment, why ...
user avatar
  • 8,316

Only top scored, non community-wiki answers of a minimum length are eligible