Most Popular
1500 questions
4
votes
1 answer
Asset Volume using Environment Variable on File System Path as literal string on upload
I have a volume called "Website" with a File System Path that uses an environment variable, $ASSET_ADHOC_PATH. The variable has been setup in my .env file as follows:
ASSET_ADHOC_PATH="/home/theadhoc/craftcms/web/assets/theadhocracy"
The Volume has…
theAdhocracy
- 302
- 1
- 7
4
votes
2 answers
When creating a fieldtype how do I provide methods to be used in the templates?
I have created a fieldtype that saves a single integer to the database, it has some settings that defines the maximum value that integer can be:
protected function defineSettings()
{
return array(
'maxNumber' => array(AttributeType::Number,…
Josh Angell
- 2,311
- 16
- 23
4
votes
1 answer
Craft 3 Image quality is terrible after asset upload from admin panel
After I upload an asset (png), the image loses quality. I changed the defaultImageQuality from its default value of 82 to 100 but didn't make a difference. I can't add these assets via FTP as I need users to be able to add them from the admin panel.…
Lara Hilal
- 103
- 6
4
votes
2 answers
Customizing Stripe payment form for Craft Commerce 2
Where does one start with matching the style of the Stripe payment form to the rest of the site?
Using Stripe for Craft Commerce Plug-In
{{ plan.getGateway().getPaymentFormHtml({})|raw }}
This enables the form with Card Holder info and credit card…
SoHo
- 403
- 2
- 10
4
votes
3 answers
Plug-ins for static hosting?
Our local dev environment allows us to run a CMS like Craft but our (government) host is static only. We currently accomplish things with movable type 4, but would like something more modern. MT 7 costs $1000 a year, so that is right out.
Is there a…
M Smith
- 150
- 6
4
votes
1 answer
What password requirements exist for new users?
My site contains a front-end registration form. New users will be automatically activated, and can begin using their account immediately.
What password requirements exist?
I vaguely remember a 6-character minimum... Is that accurate, and are there…
Lindsey D
- 23,974
- 5
- 53
- 110
4
votes
1 answer
How to order or filter entries by their author's custom field?
Is it possible to order and/or filter all entries from a section whose author has a custom field value that is set to "X"?
Below is the starting code.
in Twig:
{% set elementQuery = craft.entries()
.section('sectionHandle')
…
Ben Croker
- 7,341
- 26
- 55
4
votes
1 answer
Headless CraftCMS as mobile app backend, requiring login
Currently building a mobile app with Phonegap, I'm able to use the Element API for many features, but when comes the time to use Craft as a loggedin user, I run out of ideas.
I read a lot of things about headless Craft, but I found nothing about the…
r-ninja
- 147
- 10
4
votes
2 answers
Running Craft updates
This is a newbie question regarding running Craft updates. In the past I've been caught out by stupidly running updates on the live server. I'm now trying to get into the habit of running the updates on a local version, then pushing that to the live…
Andrew
- 738
- 1
- 5
- 11
4
votes
1 answer
How to loop through category group and identify those related to entry
Looping through a category group to show links to all the categories. This is an entry page and I want to highlight any categories assigned to the entry. How do I do that? I've tried this so far:
{% set cats = craft.categories.group('events').find()…
Clive Portman
- 2,908
- 17
- 36
4
votes
3 answers
Plugin won't enable
I have created my own plugin. It works on my Mac but when I try to enabled it in my Debian server it shows as Disabled with a red dot. What's the best way to debug this?
I have not found anything particularly illuminating in the logs yet.
Henry
- 396
- 2
- 6
4
votes
1 answer
Maintaining order when getting by entries by ID
I'd like to get a certain set of entries in a specific order, but the element query comes back ordered by the default 'postDate desc'
{% set ids = ['4213','3200','4204','4212']
%}
{% set orderedEntries = craft.entries().id(ids).order('id').all()…
Toby Stokes
- 95
- 4
4
votes
3 answers
How do you save a new Entry to be enabled on 2+ Sites?
I've made a plugin that let's you import Entries from a CSV file and I'm working through adding localization (Sites) support to it, but I can't figure out the right way to enable an Entry for a second Site.
$entry = New Entry();
$entry->authorId =…
khamer
- 281
- 1
- 6
4
votes
1 answer
How to create custom field type in Craft 3
I have been struggling to create my own custom field, so I would like to ask how to create it.
First of all, I don't know where the files should be in.
I have some custom fields in Craft 2.
It might be able to be migrated, but it is not.
I have…
Kota.M
- 423
- 3
- 12
4
votes
2 answers
Counter for entries to show most read Articles
How can I add a counter or something similar to my entries, so that I could loop through the most read articles?
Wobee
- 328
- 2
- 9