5
votes
Plugin "Typed Link Field" -> Alternative for Craft 5?
You can somewhat replicate it in 5 with an Entry Type and conditional fields that only expose the particular field based on the value ofa dropdown for type selection. I'm not sure how efficient that ...
4
votes
Accepted
How to add the option for a link to select a target, e.g. open link in new window? [CKEDITOR Plugin]
Don't include EditorClass.create in the JavaScript config. Creating the CKEditor instance is handled by the Craft plugin. The JavaScript code in the configuration should just return an object with ...
3
votes
DDEV and Craft project structure problem
Change the working_dir for the web container:
ddev config --web-working-dir=/var/www/html/craft
Or manually edit .ddev/config.yaml:
type: craftcms
docroot: public
...
working_dir:
web: /var/www/...
3
votes
Accepted
DDEV and Craft project structure problem
You already know using a non-standard folder structure is going to cause pain, but here we.
If the site is working, but the ddev craft command is not, let's override the command.
Add a new file: ....
3
votes
Accepted
Get all revisions of an entry on front end / with twig
You can fetch the revisions of an element using the revisionOf() method on an element query.
{# @var entry craft\elements\Entry #}
{% if entry.hasRevisions() %}
{% set revisions = craft.entries....
3
votes
Accepted
How to run the queue via CronJob?
You're not pointing at the craft binary. In your project root directory there should be a file named craft, with no file extension (unless you've renamed it to v1?!). Point to that file and it should ...
3
votes
Accepted
Craft 5, CKEditor accessing parent entry from partial
CKEditor entries (and Matrix entries; collectively known as "nested" entries) in Craft 5 doesn't have a parent (like an entry nested in a structure section would) – they have an owner.
To ...
3
votes
Accepted
Redactor no longer maintained
CKEditor plugin, which is also a first-party plugin by Pixel & Tonic.
https://plugins.craftcms.com/ckeditor
The Craft 5 version allows for embedding other entries as part of a long form content ...
3
votes
Accepted
Craft5 -> CP: Field groups are gone?
At the moment they are gone (and I miss them, too). You could upvote https://github.com/craftcms/cms/discussions/14600
3
votes
PHP invalid syntax error during Craft 5 Installation
This has got to be a MAMP bug with Composer.
I get the same thing trying to install a Laravel application:
composer create-project --prefer-dist laravel/laravel testproj
...
> @php -r "...
2
votes
Redactor RTE -> what about Craft 5?
Edit: Redactor 4.0 has been tagged, adding Craft 5 compatibility. It can be installed by changing your dependency on craftcms/redactor in composer.json to
"craftcms/redactor": "^4.0&...
2
votes
Accepted
Upgrade to 5.x failed
You'll have to change your dependency on craftcms/generator in your composer.json file to this (it's likely in the require-dev section):
"craftcms/generator": "^2.0.0"
...
2
votes
Plugin "Typed Link Field" -> Alternative for Craft 5?
Currently my plan is to build a matrix field in Craft5 but I would appreciate it that we have something within the core.
2
votes
Plugin "Typed Link Field" -> Alternative for Craft 5?
There's several paid plugins, "Link It" is popular and has been around through a few versions of Craft. Hyper is newer but has had good reviews.
I'll also provide a link to the CMS feature ...
2
votes
Accepted
2
votes
Accepted
Local Storage with Sprig
Does it have to be local storage? If a cookie would work, then you’d be able to achieve this directly via Twig code.
{{ sprig('_components/groupCards', {
entryId: entry.id,
order: craft.app....
2
votes
Accepted
How to lowercase the value of a variable used as default upload folder for assets?
Assuming that spaceId is a dropdown field(??) I believe you'll want this:
{spaceId.value|lower}
If you dump out a dropdown field in a template you'll notice that it doesn't give you a simple value, ...
2
votes
HTTP 503 – error found in newly installed craft cms
Usually you see this error when Craft CMS is not installed yet or the credentials to the database are not correct. You can run the Installer from the command line via ./craft install or by going to ...
2
votes
Accepted
Setup Craft CMS 5 webroot to htdocs
In your project root is a hidden .ddev directory. Inside of that directory, edit the config.yaml file and change docroot: web to docroot: htdocs.
Restart DDEV.
You'll also need to update your Craft ....
2
votes
Craft 5 Matrix Field have URL?
Yes, you can do that in multiple ways. You can create a section and add the entry type for your staff members to it, then set the URI setting of the section to something like /staff/{slug}. ...
2
votes
Accepted
Can I empty the storage folder when migrating a Craft CMS site?
The storage folder should be safe to empty out. In a vanilla Craft install, there shouldn't be anything in there that won't be regenerated (i.e. caches, compiled templates, etc), or that your Craft ...
2
votes
Accepted
Not able to query by id
I just found the answer here: User query in PHP does not work
I have to add "anyStatus()" to my query:
$comment = Entry::find()
->section('articleComments')
->id($...
2
votes
getBodyParam('email') is empty on live server
Discovered there was an NGINX config that was adding trailing slashes to URLs. Posting to the URL /api/controller-action was getting changed to /api/controller-action/ and emptying the POST data.
2
votes
Accepted
Set Field Layout for User Groups
Associate additional fields/data with user groups
You can't define a field layout for user groups, as user groups don't support custom fields. User groups are not much more than a way to categorize ...
2
votes
Accepted
How do I toggle at content level Craft 5 Multisite
Entries in sections that are enabled for multiple sites will have a site switcher menu in the breadcrumbs:
You can enable an entry in additional sites using the Status section in the sidebar:
2
votes
How to pass a chunk of twig from an 'include' statement?
What you're trying to do is possible using "variable variables" (i.e., a Twig object with a dynamically named sub-property), however in my opinion a better approach would be to use embed ...
2
votes
Accepted
Does a sortable Sprig 'board' need to use a table structure for full functionality?
No, Sprig is entirely flexible and does not impose specific requirements on your markup. While using a table might be better in contexts where the data is best represented in that format, you won’t ...
2
votes
can I 'switch' entry types rather than using if statements?
Yes, you can. Switch is not native to Twig, but Craft adds its own switch tag to the language, as per the Tags documentation here, which works exactly as you have demonstrated: https://craftcms.com/...
1
vote
DDEV and Craft project structure problem
regarding DDEV - you can adjust composer root to a subdirectory:
https://ddev.readthedocs.io/en/stable/users/configuration/config/#composer_root
For your errors:
Craft can’t connect to the database. ...
1
vote
Accepted
Problem with recursive macro descendants in craft 5
The descendants of an element include anything nested within it, regardless of depth.
I believe what you want is children:
{% set topLevelComments = craft.entries()
.section('articleComments')
....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
craft5 × 67matrix × 9
craft4 × 5
plugin-craftcommerce × 4
frontend-form × 4
plugin-sprig × 4
templating × 3
plugins × 3
control-panel × 3
migration × 3
modules × 3
upgrades × 3
graphql × 3
ckeditor5 × 3
entries × 2
assets × 2
relations × 2
entry × 2
php × 2
field × 2
redactor × 2
controller × 2
entry-type × 2
updates × 2
sorting × 2