Hot answers tagged


Set the limit to null limit(null).


If there was no default set beforehand, then your previous elements will have a value of null for that field. You should be able to include those in your "on" queries by querying for that null value as well as the "on" value in your templates: {% set onEntries = craft.entries.yourLightswitch([null, '1']).find %} This won't actually change the value of your ...


For entries previously created, the lightswitch field will not be on even if you specified that as a field option. However, new entries should respect that field setting. Are new entries not honoring your field settings?


Yes, if you don't include the dropdown field in your entry form, Craft will store the default value for that field, if one has been set. If no default value has been set, then the value will be null.


As of Craft 3, there is no limit by default. Per the CHANGELOG: Element queries are no longer limited to 100 results by default. (Credit to Ben Croker who originally added this answer as a comment above. Adding this here as it would be better as the upvoted answer.)


You need to update the locale to en_ca in the control panel under Settings->Locales.


You will only get the defaults for new entries.


In Craft 3 the place that users photos get stored in are proper Asset Volumes, meaning they can be stored in a folder on the local file system, or on S3, Google Cloud, or any other place that a plugin provides a Volume for. Once you create a Volume for user photos, go to Settings->Users->Settings in the Control Panel and you can choose that Volume under the ...


Entry fields do not natively support setting a default entry, but you can use the Globals section to achieve the same effect. Create a 'Default Call to Action Entry' field in your globals, and set the default entry for all pages there. For extra functionality, I would then also have a 'Call to Action Entry' field on your entries. With this set-up, a user ...


First of all I would like to leave a few links for you. is a page where you can create your "starting" files. It creates an empty Plugin, with all the required files/functions with example codes for routing and services.... The Docs about Craft Plugin developement Then to the code: you'll need to insert a function like this in your Plugin'...


I am only able to speak about Craft 2x, as I am not familiar at all with how Craft 3 handles profile images. Here is where Craft 2x stores any uploaded profile image: /craft/storage/userphotos/ It is kind of a special asset source that isn't accessible like you would find an asset field that you create is. You can render the image, but as far as I know, ...


This is the mySQL query I have used to update a lightswitch field in the database. UPDATE `table` SET `field_name` = replace(field_name,'original content', 'updated content') for example: UPDATE `craft_content` SET `field_imageLightbox` = replace(field_imageLightbox,'0', '1')


There very definitely is a default limit of 100 and using .limit(null) will definitely override it. I know this because I recently had the same issue myself!

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