All Questions
14,273
questions
0
votes
0
answers
52
views
Migrating from CraftCMS to Wordpress (Metadata question)
My company is working to migrate 7 websites into a single integrated website. However as we are migrating this with our CMS partner we are seeing that no metatitles and metadata are being transferred ...
1
vote
2
answers
42
views
Update Craft Commerce cart with ajax
Have been trying to get cart updates via ajax.
I've looked at this answer:
'https://craftcms.stackexchange.com/questions/17347/update-commerce-cart-using-ajax'
My cart seem to update ok but I can't ...
1
vote
1
answer
34
views
Calling a Function From Private Plugin
Writing my first plugin. Scaffolded with Generator and is active (appearing in admin). This is where most tutorials leave you on your own so hoping to get some help calling a simple function in my ...
1
vote
1
answer
30
views
Can plugins have their own routes?
I'm writing a plugin. I'd like it so that a request to view the page is processed via a Controller rather than goes straight to a template (following an MVC pattern).
So a GET request to the URL of ...
1
vote
1
answer
28
views
Slug: German "Umlauts" (beyond limitAutoSlugsToAscii) // db storage
Is there a chance to avoid German "Umlauts" (äöüß) for the slug?
I'm aware of this: https://craftcms.com/docs/4.x/config/general.html#limitautoslugstoascii
But the editors can edit the slug ...
1
vote
1
answer
37
views
Image Editor: Remove "focal point" and "custom"
Is there a way to remove "focal point" and "custom" options from the image editor?
Custom ratios are documented here: https://craftcms.com/docs/4.x/config/general.html#image-...
1
vote
1
answer
56
views
I have an existing project called Craft cms v3.3, what should I do if I want to run it at local?(Mac OS)
I currently have a project that is definitely craft cms v3. I want to run it but this is the first time I keep stressing over it. Please help me
1
vote
1
answer
26
views
Verifying hCaptcha plugin submission on the server side
So I'm mostly a front-end developer working with craft. I'm using the craft contact form plugin and I'm trying to setup hcaptcha plugin to work with it. But I'm not sure how to implement the server ...
1
vote
1
answer
60
views
Craft 3 DDEV Migration: "No database has been selected yet"
I've hit a snag while trying to move my Craft 3 project from MAMP to DDEV. First I installed a new DDEV project using the php project type and MySQL 8.0 for the database. Then I imported the database ...
1
vote
1
answer
67
views
Updated to PHP version 8.1.22 and one of my Craft 3 sites is getting a critical error
I upgraded my server to PHP 8.1.22 in order to start a new Craft 4 site, and one (but not all) of my existing Craft 3 (3.6.17) sites is giving me the following error. How do I resolve this error? See ...
0
votes
0
answers
26
views
Is it possible to change built-in field like Table with a module?
Is it possible to change behavior of in-built field with a module?
I am trying to change // Apply static translations part of _normalizeValueInternal function in Table.php
https://github.com/craftcms/...
1
vote
2
answers
28
views
How to stop all the solspace calendar views from being crawled by search engines
I have an additional hundred thousand pages being crawled by google and I do not want them to be crawled by any search engines.
Example: https://www.ucbcanada.com/events/month/2664/04
I have week ...
1
vote
1
answer
35
views
twig: loop and switch within set -> dirty code or pragmatic solution
First of all: My solution works ... I can not see any problems.
But I'm very unsure whether my code ist a dirty hack or not.
Please don't care about details in my code ... I'm uncertain because:
There ...
1
vote
1
answer
46
views
Only show entries related to child category if it exists
I have a categories field for outputting products to a map. The categories linked to that field have a parent/child relationship.
With {% set products = craft.entries.section('products').relatedTo(...
1
vote
0
answers
36
views
Bulk Entries Migration works on local, but not updating elements in production
I'm trying to bulk update records based on a condition but the entries are NOT getting updated even though the migration seems to go through. Both code samples below work locally but NOT in production ...
0
votes
0
answers
49
views
Craft 2 - Referencing Twig Variables in Javascript - Variables Do Not Exist
I'm working with a template in Craft 2, and in referencing Twig variables in the Javascript, they are not recognized when the page is previewed. I get a Template Error - Variable x does not exist
...
1
vote
1
answer
36
views
Why do I only have 3 options under 'Commerce' in Craft CMS Solo 4.5.6.1?
I have installed Craft Commerce 4.3.0 on Craft CMS Solo 4.5.6.1 on localhost (Xampp), but only have 3 options under 'Commerce' in the left-hand menu - Orders, Promotions, Store Settings.
Do I need to ...
1
vote
1
answer
42
views
RSS feed displays, but does not validate because of a 404 error
I have created an RSS and Atom feed as specified here. You can view my example feeds: RSS or Atom.
The files are both called feed.feedtype.twig, as specified. I am running Craft CMS 4.
As you can see ...
2
votes
1
answer
25
views
Get list of user logins
I would like to get a list of every login of a user. I know I can get a certain user with craft.users() but as far as I have seen, I get data for lastLoginDate only.
Is there a way to get a complete ...
1
vote
1
answer
41
views
Image path is broken after updating site from Craft version 3 to 4
I am currently in the process of upgrading my site from 3 to 4. My craft CMS version is 4.4.16.1
None of my images are loading in the site after performing update. Our images are stored in AWS.
Upon ...
1
vote
2
answers
75
views
Uploading (multiple) assets to assets controller via front end with Craft 4
I'm trying to upload assets directly to a volume using the 'assets/upload' controller in a front-end form.
There must have been some changes since Craft 3 and I'm running into 2 issues:
Issue 1: ...
1
vote
2
answers
55
views
Setting up Feed Me with and API Auth Token that changes every 15mins
I have setup a feed using Feed Me and have added the Authorization header token but the API changes the Auth token every 15min. Which I need to copy paste into the config file.
Is there an easy setup ...
1
vote
1
answer
28
views
Sort articles by seq() value
Im trying to create a view for most viewed articles. I tried with entryCount plugin as recommended here
but unfortunately, when you have more than 500 articles in the last 3 weeks that I'm checking, ...
0
votes
0
answers
27
views
Creating a User without email requirement and auto-activation from a Controller
I'm working on a project where I use Craft CMS to manage user sessions and store user preferences such as site version and preferred language. However, for privacy reasons (GDPR compliance), I'm not ...
1
vote
1
answer
17
views
Filter entries on dropdown field value
I have a series of entries and I want to only display ones whose dropdown field matches a certain value. At the moment, my unfiltered query is like this:
for item in entry.children.limit(6).orderBy('...
1
vote
1
answer
22
views
Alias not being resolved directly within an attribute in Twig templates
Is this a bug or is this me ? (I'm a new to craft)
When using the @web alias directly within an attribute in a Twig template, the alias doesn't seem to be resolved to its corresponding URL. Instead, ...
1
vote
1
answer
66
views
Search index doesn't update
I've needed to to add a few fields to the search index «Use this field’s values as search keywords» after quite a few entries already have been created. Now the search index doesn't seem to get ...
1
vote
1
answer
24
views
Page Breaks in CKEditor
I've added a page break in my CKEditor field. When I output the field in my template it dumps everything in the field. How do I withhold the content after the page break?
1
vote
1
answer
58
views
Adding an external link to a menu (beginner)
I have inherited our website which is built on Craft CMS. I need help figuring out how to add a link to an external URL from a menu on our site: https://sofheyman.org/
I cannot figure it out. Can ...
1
vote
1
answer
91
views
In Craft CMS CP plugin, how can I intercept the lightswitch.php getTableAttributeHtml?
I'm trying to make a basic plugin that intercepts Lightswitch.php and edits getTableAttributeHtml
Here is the current way:
public function getTableAttributeHtml(mixed $value, ElementInterface $element)...
0
votes
0
answers
35
views
In Craft CMS CP plugin, how can I get the current entries relevant to the view I'm on? Trying to edit the Lightswitch field for all entries
In Craft CMS CP plugin development, How can I get the current entries relevant to the view I'm on?
Event::on(
View::class,
View::EVENT_BEFORE_RENDER,
function ($context) {
$entries = ...
0
votes
0
answers
17
views
Whats is the correct way to save and retrieve an entry or assets in a custom record?
Let's say i have a custom ActiveRecord and want to save a single Asset or an Entry relation (one to one) inside one of it's columns, what's the correct way to do this?
1
vote
1
answer
37
views
Front-end user registration doesn't return validation errors
I've activated public user registration using the register.twig template mentioned in the documentation: https://craftcms.com/knowledge-base/front-end-user-accounts#registration-form
Unfortunately the ...
0
votes
0
answers
8
views
Plugin that lets me "reset" second language to match primary language, per entry
I am running a multisite install with two languages: Norwegian and English.
Sometimes I copy an existing entry to use as a template for the next entry. In those cases I would like to fill in the ...
0
votes
1
answer
19
views
Admin Panel: Channels Grouping in Multiple Groups
In the admin panel, under "Entries", the "Channels" grouping has become disorganized as I have added new Channels over time. It seems as I add new channels, they stick to a group ...
0
votes
1
answer
26
views
Grouping and ordering entries by month
I need to be able to group dates by their month but then order them by month too because the order they're inserted into the database in na super field table isn't always in date order.
So far, I have ...
1
vote
1
answer
52
views
Custom Element Type Documentation not working or confusing
Following the docs on the offical CraftCMS website i'm not able to get "Native Layout Elements" saved. My field body is always empty. Any idea what i'm missing here?
Relevant Part of Plugin ...
0
votes
1
answer
19
views
Entry's post date in multisite
we are using multi-site setup to run 2 websites in different languages. We share articles between both sites and display some of them on the home page as "recent articles". Since the ...
0
votes
0
answers
29
views
Custom plugin blocking upgrade
I've created a plugin which I'm adding to my project like this in composer.json:
"repositories": [
{
"type": "composer",
"url": "https:/...
0
votes
1
answer
34
views
Issue with Multiselect field and related entries
I am having an issue outputting news stories that are filtered via a multi-select field, newsCategory is the the multi-select fied handle.
Here is my code
<div class="search-results search-...
0
votes
0
answers
44
views
composer update for Craft 3 to Craft 4
Trying to migrate a site from Craft 3 to Craft 4. Carefully followed the instructions to update my composer.json file to reflect the Craft 4 versions of Craft and all plugins. When I run composer ...
1
vote
1
answer
64
views
How to extend or override CP template?
I need to add some custom condition to the top siteMenu selector.
Template file with top menu:
vendor/craftcms/cms/src/templates/_elements/sitemenu.twig
Block with this menu:
vendor/craftcms/cms/...
0
votes
1
answer
21
views
Upgrading to Craft 3.7 errors
i am trying to upgrade one of my sites up from Craft 3.6.17 to 3.7 and if i try and upgrade at all i just seem to get the following errors:
Any ideas what I need to do?
Database Exception: SQLSTATE[...
1
vote
1
answer
48
views
Upgrading to commerce-stripe v4.0.0
I am just upgrading my clients site and have upgraded all plugins including commerce-stripe up to v3.1.1. I want to upgrade to v4.0.0 for commerce-stripe but keep getting the following message - does ...
0
votes
2
answers
24
views
Craft 2 Caching RESTful API Results Displayed On Page
I have made a php plugin in Craft 2 which calls a RESTful API and displays the results on the template. The data is returned at about 8 seconds. I've surrounded the call to the plugin on the ...
0
votes
0
answers
27
views
Disable specific search syntax with colon
I have a search page which searches in products.
Unfortunately some of these products contain a colon : in the title.
This triggers the search syntax that is built into Craft.
How can I disable this ...
2
votes
1
answer
901
views
RCE in CVE-2023-418925: Can it be exploited without being logged into Craft?
Does anyone know if the RCE vulnerability in CVE-2023-418925 (Github link) can be exploited without being logged into Craft? I have a couple of smaller sites that I'd rather not update right now.
0
votes
0
answers
37
views
Prevent user email validation message showing twice In craft panel
When i enter same email which is already exist and click on save it is showing twice message. Can you please tell me it is craft cms's behavior?
I have checked by disable custom modules and also ...
1
vote
1
answer
66
views
Can you create a pop-up in Craft?
Is there a way to create a pop-up for when someone visits the site on the backend of Craft?
0
votes
0
answers
27
views
Changing Matrix Field Propagation Settings
I built a Craft multisite a few years ago. Most of the site pages feature a content builder matrix field with multiple blocks. Many sections are shared across sites.
When I built the site, it seemed ...