Questions tagged [craft3]

For use with questions relating to the Craft 3 version of Craft CMS, including the Beta and RC releases.

Filter by
Sorted by
Tagged with
0
votes
1answer
28 views

Inconsistent search results in multi-site setup (prod/stage)

I have set up a staging site alongside production just like the docs describe (Craft Solo 3.4.24). I have copied the "Site Settings" for all sections and set the "Propagation Method&...
0
votes
1answer
21 views

Query only Tags wich are not connected to a revision

I wrote a query like this: $query = (new Query()) ->select('COUNT(elements.id) as count, tags.*') ->from('relations') ->join('INNER JOIN', 'tags', '{{relations}}....
1
vote
2answers
42 views

How to loop through multiple entries fields

I'm creating a dynamic side navigation where pages can choose which sidebar it wants to use. This is selected by an entries field called 'sidebar' - called in line 2. To create this I've made a ...
1
vote
1answer
52 views

Craft CMS Entries Disappearing

I've setup a Craft 3 site for a client and we are seeing the strangest thing where pages are just disappearing. Best we can tell no-one has deleted the entry, but we get a 404 on the front-end and it ...
0
votes
1answer
33 views

Rendering a template from a controller - unable to find template

Once again going out of my mind trying to figure something out... I have a custom controller which I want to return a rendered template. The template should, ideally, reside in my front end templates ...
1
vote
2answers
23 views

Sort Entries by Value from Dropdown

I have a list of students and can sort them by name, sport, and school. The name and sport portions are easy, I'm grabbing the values without issue. Where I'm struggling is the school value is from a ...
1
vote
1answer
14 views

Craft Commerce Product Options that increase price, but do NOT affect stock

My client wishes to sell artwork online. They're all one-off pieces and once one is sold, it should not be available to purchase thereafter. However, the artwork needs to have an option to be framed ...
0
votes
0answers
19 views

Updating Search Indexes failing because of “rouge” invalid field handle

I'm on the latest build 3.5.3. I created a Lightswitch field type within a Matrix field in my local dev env and called it "colorBlock". No problems there. When I recreated this in my staging ...
2
votes
1answer
26 views

Licence error and update issue cause of same plugin name / handle

We developed a plugin with the name "poll" (composer.json: webhub/poll) for one single project. Now we get the licence error in the control panel, cause there is a plugin to buy which has ...
1
vote
0answers
20 views

Translation filter in Sprout Email plugin

I would like to make a notification of Sprout Email plugin bilingual. However, in the body field, the translation filter does not work. The tag of {{ fieldname.label|t }} is not translated. How is it ...
1
vote
1answer
102 views

Why is $DEFAULT_SITE_URL appearing in entries URL?

I have an entry loop on my homepage that uses {{ entry.url }} that links to the full entry. When I click on the entry, the url looks like this mydomain.com/$DEFAULT_SITE_URL/the-entrys-slug Even ...
2
votes
1answer
130 views

Craft 3.5.1 CLI Update Error: Failed to instantiate component or class “yii\shell\Bootstrap”

when I try to update Craft via CLI to 3.5.1. I get the following error: Failed to instantiate component or class "yii\shell\Bootstrap in /vendor/yiisoft/yii2/di/Container.php:449 Stack trace: #0 ...
0
votes
0answers
30 views

How can I add data to a matrix field from a module without overwriting existing data?

I have an entry that has a matrix field. From a controller in a module I want to add additional data to it (e.g. some text that I have in a variable $messageText) but without overwriting the existing ...
2
votes
1answer
41 views

Help understanding hooks

I need to build a plugin or module that hooks into the Sprout form upload file function so I can add text programmatically to the user uploaded filename. I've had input before that I should work with ...
1
vote
2answers
28 views

Craft 2 to Craft update - timeout when updating database

I am trying to update a site from Craft 2 to Craft 3. I first set up a new server, installed Craft 3, copied over config settings from the original site, and moved over a copy the original database. I ...
1
vote
1answer
52 views

Random duplicate DB query issue

Can anyone shed any light on this duplicated db query issue? I've noticed when going through my site with the debug toolbar on, sometimes when I click a page or entry there is often double the amount ...
1
vote
1answer
31 views

Looping on the User Field added to Entry

I am fetching the fields of an entry in a block but can not draw through a user field named as eventHost. I get error 'Variable "name" does not exist.' What is wrong with my loop? {% set ...
3
votes
1answer
44 views

Custom CP Element Indexes

I'm working on a custom Craft 3 site, and I need to be able to configure the element indexes within the control panel for a few of my custom EntryTypes. There's two particular things I'd like to ...
0
votes
0answers
38 views

How how can I restrict/fail a login using a User::EVENT_BEFORE_AUTHENTICATE hook?

When a user attempts to login, I check a 3rd-party to make sure they should have access. If they shouldn't, I need to stop them logging in. I have this working, but I could only get it working by ...
2
votes
1answer
43 views

Cleanup Craft Logs

Whenever I have PHP problems I'm looking into the Craft CMS logs. However, at first I noticed there's a ton of stuff getting logged which is useless for me. Under this amount of logs, I can't find ...
0
votes
0answers
50 views

Craft CMS hangs when deleting a field then throws 504

We have an instance of Craft CMS running that has a lot of content entries and a lot of fields, using Neo and SuperTable. At some point, something changed and now when we try to delete one of the ...
1
vote
1answer
30 views

How to create different template for specific page?

I have added a "newsletter" page under Admin > Entries > Page [New Entry] And the page is opening fine on the url xyz.com/newsletter But I want to assign a different template to this ...
0
votes
0answers
20 views

How to get a few category groups in a single endpoint using Element API plugin?

I have many category groups and want to get some of them using single endpoint. Is it possible? If so, how? Code like this return only one group: 'api/header.json' => function() { $...
1
vote
1answer
25 views

Accessing Commerce ‘Product Fields’ in events hooks

I've added an Entries field called linkedCourseEntry to a Product (Product Type > Product Fields tab). In the Product itself I've assigned an entry. I need to access linkedCourseEntry from one or ...
1
vote
1answer
24 views

Do I have to restart apache server every time I change a Craft PHP file?

When I make a change to a .php file of Craft, say config/routes.php, do I have to restart the server to take effect ?
0
votes
0answers
24 views

Filter Entry Query by Category

I'm making a staff page. The entries are in the section 'people'. There are four types of staff - leadership, wardens, staff, safeguarding - so there is a category field for each 'staffCategory'. That ...
1
vote
1answer
80 views

The requested URL was not found on this server. Apache/2.4.18 (Ubuntu) Server at localhost Port 80

The frontend just work fine. But when I call the backend http://localhost/craft3/web/admin/dashboard/ or http://localhost/craft3/web/admin/ I get the error requested URL was not found on this server. ...
1
vote
1answer
38 views

How to use categories with Sprig's “Load More” recipe

I am trying out Sprig's "Load More" Recipe and I am trying to call up entries that are related to the current category page. But when I add .relatedTo(category) to the entry model, it doesn'...
1
vote
1answer
26 views

Help selecting an e commerce framework

So i have a client that wants fast e commerce store, currently I've narrowed it down to 2 solutions. Headless Magneto CMS with a Magneto PWS studio as the front-end. Its based on react which should be ...
0
votes
0answers
13 views

Can Feed Me create an example feed file from local fields?

While trying to configure a feed and looking for documentation, I wished Feed Me could just tell me what syntax it was expecting. Is there a way to take the fields you've got and generate a file to ...
1
vote
1answer
37 views

How to search by title OR tag using Craft CMS?

I want to do a search query so the product title or product tag name matches the keyword. below is my code. if I remove the tag related query, this code works as it looks into the product title only ...
1
vote
1answer
32 views

Restrict entries to specific users

I would like to restrict entries to specific users on the frontend via a User Field called userSelector. It should be possible to have more than 1 user. I understand groups might work, but I feel like ...
1
vote
1answer
22 views

How to prepend user input data to a filename uploaded through Sprout Forms

I have a contact form where users have to fill in a name field and upload a file. I want to add the name the user filled in to the beginning of the filename, eg: firstname-lastname_filename.pdf. I ...
0
votes
0answers
11 views

Can a redactor field be configured to save images in different folders?

Can the same redactor field save inline images in a dynamically determined folder structure? Can something like asset field's upload location be configured for it?
0
votes
0answers
16 views

Asset field upload location syntax

What's the syntax for the asset field upload location? What variables are available, and what operations are possible? We're trying to use the same field to store images from various sections and want ...
1
vote
2answers
42 views

Get entries that are enabled and disabled for the site

A Craft (3.4 Pro) website has setup two sites, one for each language. There are entries in a section that are enabled and others that are disabled for each language. I want to get a list of all the ...
0
votes
0answers
30 views

Craft CMS image src error

Good morning, I have inherited a Craft CMS site from a previous developer, and am running into issues when looking to add images to the site. Following instructions I grabbed the copy of the SQL ...
0
votes
0answers
21 views

Programmatically / with plugin create new categories and nested categories

In a custom plugin, I'm able to easily add a new Category: Parent Category Code: if ($category[1] != '' && $category[1] != -1 && $category[1] != 0) { $categoriesData = \...
0
votes
0answers
37 views

How to load more entries of a category on that category's page with Element API?

Following up on previous questions of mine: How to use multiple different instances Element API "Load More" button? I have a website that utilizes the "load More" (button) method ...
0
votes
0answers
16 views

Building a tab component in a matrix content builder - child matrixes with SuperTable plugin

There are similar questions and answers, but I'm not finding any that are answering my specific questions. I've built a content builder with a matrix in Craftcms like these tutorials have gone over. ...
1
vote
2answers
44 views

How to use different date format in front end form?

I have a date field on a front end form, currently with this HTML: <input class=" date-picker startDate" type="text" id="startDate" name="fields[startDate]" ...
0
votes
0answers
27 views

404 error when trying to access a module controller action

I’m creating a module for a site for the first time and I’m having some trouble figuring out how to get the correct action url for my controller. I’m using this template for setting up the module: ...
1
vote
1answer
46 views

How to use multiple different instances Element API “Load More” button?

Following up on a previous question of mine: How to skip the first few entries in a "load more" scenario with Element API? I have a website that utilizes the "load More" (button) ...
1
vote
1answer
28 views

How to skip the first few entries in a “load more” scenario with Element API?

I have a website that uses a "load more" button. The process for this button can be found here: http://craftsnippets.com/articles/infinite-scrolling-and-lazy-loading-with-craft-cms I made it ...
1
vote
1answer
62 views

Generate PDF Receipt in Craft commerece causes error in dompdf

We are using: Craft 3.4.20 with Commerce 3.1.4 and PHP 7.4.6 We tried to generate a PDF of an order with default settings and template in cp We got following errors: yii\base\ErrorException: Invalid ...
1
vote
1answer
94 views

Load More Entries Button

I am trying to make my entry loop have a load more button, and not sure how to do it. I tried the method from http://craftsnippets.com/articles/infinite-scrolling-and-lazy-loading-with-craft-cms but I ...
0
votes
0answers
51 views

Test mail fails, no valid recipients

One of my sites does not send mail. When testing the email settings (using the test button at the bottom of the email settings page), I get an error. My log file shows this error thrown in Mailer.php. ...
0
votes
0answers
17 views

Craft CMS + Nginx redirection

I am using the latest version of Craft CMS with Nginx server. My problem is, in my site settings i setup 4 websites that are as below: German (de-de) [default] German English (en-de) Austria (de-at) ...
0
votes
0answers
16 views

Shipping Rules and Shipping Categories

I'm trying to set up some shipping rules. I've created a new shipping category called "Sample" I can apply it to the product fine. When I set the rules I want and then head to the checkout ...
2
votes
1answer
102 views

How to check an entry is in a section within a for loop

I need to display different information depending on the section the entry comes under when I'm displaying all entries within a loop. Use case - I have a feed which will pull in all entries such as '...

1
2
3 4 5
32