10

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 other words, with your current setup, you're not actually uploading anything. In my opinion, you have two choices: Use Assets and Craft's built-in Assets ...


9

Ignore the terminology, it really makes no sense. What it should say is this... Require customers to use a PayPal account? [Sole] No, a PayPal account is optional. Customers can still choose to pay with a credit card instead. [Mark] Yes, a PayPal account will be required to complete a purchase. Here's a screenshot of the documentation... So why did ...


8

You could use craft.app.isSystemOn. This will return 1 if the System Status is "on" in Settings -> General in the control panel. It will also respect the value of the isSystemOn config setting if you're setting it in general.php


7

Here’s a simple plugin with two tabs and two fields, one field per tab. This plugin was generated on https://pluginfactory.io/. It’s a great starting point to get the plugin scaffolding set up. After that I added the code that I’ve included below to get it to work. It should give you something like the following screenshot for the first tab: and for the ...


6

You can use the EditableTable template component (i.e. the same UI component that Table fields use). Note that this will only work inside the Control Panel – not on the front end. The title of this question says "Plugin settings", so I'm assuming that's your actual use case. Here's how: {% import "_includes/forms" as forms %} {{ forms.editableTableField({...


6

Yup, you need to use AttributeType::Mixed as Justin Kimbrell suggests. The date will then be escaped and stored in the database like this: * {"newregistrationdate":{"date":"2\/1\/2015"}} Now, the dateField in your settings template will expect a DateTime object for its value – so just passing getSettings() as is will make it choke. You can get around that ...


6

For Craft 3: Craft::$app->config->general->{var name}


6

craft()->config->get('JsPath');


5

In more recent versions of Craft 2.x (I forget when it was added), you can simply do this without needing a plugin: craft.config.get('setting', 'plugin') Where 'plugin' is the name of your plugin's config file (sans .php). If you want to do this in Craft 3, you'd do: craft.app.getModule('pluginHandle').getSettings().mySetting


4

As far as accessing the value of the setting, try: $plugin = craft()->plugins->getPlugin('pluginHandle'); $plugin->getSettings()->getAttribute('pluginSettings1'); If you need to access your settings throughout your services file you might also create a global variable. class PluginHandleService extends BaseApplicationComponent { public $...


4

Not sure if there's a build in way, but you can set up a template variable that returns the settings model. class MyPluginVariable { public function settings() { return craft()->plugins->getPlugin('myPlugin')->getSettings(); } } Then access it in your template. {% set settings = craft.myPlugin.settings %}


4

I think you are referring to the System Email Address under "Settings" -> "E-mail" -> "System Email Address".


4

There's a chance that one of your plugins is causing this behavior. Go into your craft_plugins table, and change the value of enabled to 0 for every single plugin. If your Settings page is then accessible, cautiously re-enable each plugin one-by-one. This will help you hone in on which plugin may be causing the problem.


4

You set it to whatever timezone the content authors will be in, so for example, when they say an entry’s post date is at 10 AM, Craft knows which timezone that should refer to.


4

Not an easy way to do this in Craft 2, but this is possible in the upcomgin Craft 3 (currently in beta) using craft/config/app.php, which is multi-environment aware.


3

If all your tables should use the same class or classes, you could use my Retcon plugin to add the classname(s) in Twig: {{ entry.body|retconAttr('table', {class: 'someclassname'}) }} If different tables need different classes, this isn't a solution, though.


3

Well... the answer was quite simple. 'siteUrl' => array( 'en_ca' => 'http://localhost/mysite', 'fr_ca' => 'http://localhost/mysite/fr', ), The _ca part was what was missing. Now my site works amazingly. Sorry for the run around and I hope this can help someone.


3

The solution provided here actually required some adjustments. Here is what ended up working: In craft/plugins/sample/SamplePlugin.php: <?php namespace Craft; class SamplePlugin extends BasePlugin { function getName() { ... } function getVersion() { ... } function getDeveloper() { ... } function getDeveloperUrl() { ... } public ...


3

I didn't have time to setup this scenario locally, but you may want to use AttributeType::Mixed. I believe the dateField macro returns the value as an array, so using AttributeType::Mixed should allow that value to be saved. All your other code looks correct, so it has to be your settings model not getting populated correctly.


3

Shameless plug: We've written a plugin that automatically updates your email settings depending on your environment. It's not free, but it is cheap :-) Please check out the page on our website for more information.


2

Copying from the widgets settings I made something that sort of works: Define the setting to be type mixed: protected function defineSettings() { return array( 'jobsemail' => array(AttributeType::Mixed, 'required'=>false), ); } Then create a settings.html like this: {% import "_includes/forms" as forms %} {%...


2

You should be using forms.radioGroupField instead of forms.radioGroup, just like you're using forms.lightswitchField.


2

I'm not sure how to do a 3 way toggle with radio boxes, it might involve writing your own JS... but for the checkbox toggle it's pretty straight forward :) {{ forms.checkboxField({ ... toggle : 'toggleThis' }) }} <div id="toggleThis" {% if settings.eventClickDestination is not defined or not settings.eventClickDestination %} class="hidden"{% ...


2

You can configure the Redis cache driver to use an external host, see the config page for the documentation and here for details on copying the default Redis config file and configuring it. Long story short... Copy craft/app/etc/config/defaults/rediscache.php to your craft/config/ folder and configure the settings as you wish.


2

Ideally I'd like to keep it separate as eventually the CP will be swapped out for a front-end solution, so any clues as to why this is happening? I think you're close. Just so we're on the same plane, you're using the CP for users to edit their profiles but everything else is on the front end? Do you have a front end login form already setup? If not, get ...


2

This had me stumped for a while, but it turned out to be a custom fieldtype extending BaseElementFieldType, in which the settings attribute targetLocaleField apparently was renamed targetLocaleFieldHtml with Craft 2.5.2750. Not sure why the error was thrown for all fields and fieldtypes (even PlainText fields), but in any case the fix was simply replacing ...


2

What I would probably do is to create a new branch in version control that you can deploy to production as long as you have to disable the locales. The reason for this is that there are probably too many things you have to change in code and I wouldn’t want to clutter it with a lot of conditionals. In that new branch you would have to delete the index.php ...


2

How about hiding the language switcher on the front-end?


2

Just remove the extends and set content. The settings twig-code is rendered in a container inside the CP anyways: {% import "_includes/forms" as forms %} <p>Hello Craft</p>


2

This makes more sense :) So basically, you want to have info from one entry on multiple pages and your problem is that in the section settings, you can only define 1 template for an entry. One way to go about this is to create your own urls when clicking on an entry where you add the {slug} of your entry to the url, something like this: {siteUrl}/episode-...


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