All Questions

0
votes
0answers
4 views

How can I conditionally resave entries based on the value of an entry's field in a Craft 3 Module/Plugin?

Scenario: I want to programatically bulk resave entries in a certain Site in a certain Section of a certain Type. I have a Craft 3 Module with a Console Controller containing following code: public ...
1
vote
1answer
7 views

Locked out of my Account, how to get back in?

This really stressing me out! When trying to log back in to Craft CMS today after som time my password wouldn´t work. I have not changed it and when trying to reset the password I´m only getting: "...
0
votes
1answer
6 views

Query Craft CMS Table Field with exact values

Am i correct in saying you cannot search for specific text in a table field. EG Table Fields Might hold the following data: SKU1 SKU2 SKU3 SKU33 I then want to search for items thats only return ...
0
votes
0answers
13 views

Hide some Channel entries via custom plugin

I' developing a plugin that will give an ability to restrict access to some entries from a channel. So the logic is: I have a Usergroup - Channel and User - Entry relation table in my database. ...
0
votes
0answers
6 views

“Hanging / freezing” when trying to delete anything

There seems to be an issue where the system crashes or freezes whenever I try to delete anything in the control panel. When I try to delete a field, a field group, a category, a category group, and ...
0
votes
0answers
11 views

Manually passing page number to paginate tag

{% paginate %} tag takes current subpapage number from url address. Can this behaviour be bypassed and page number be passed directly into {% paginate %} tag?
0
votes
0answers
8 views

Element-api migration - entries by category

I am having trouble getting the related category passed thru to the entry api endpoint. I cant use : $criteria = craft()->elements->getCriteria(ElementType::Category); $criteria->...
0
votes
0answers
5 views

Some redactor fields pick up custom redactor configuration, while other fields don't

So I have two different redactor fields and only one is picking up the custom redactor config that I've set up (per here: https://docs.craftcms.com/v3/changes-in-craft-3.html#rich-text-fields ). If it ...
0
votes
0answers
7 views

Translation with Windows server IIS | Craft cms 3

How can we configurate the web.config so that both languages appear on the website? Because now it only shows one at a time.
0
votes
0answers
16 views

How to redirect the page

In the front-end, I create a form and submit the data to backend. In the controller, if got some errors, I would like to redirect to the previous page with some information.
1
vote
0answers
10 views

Sprout SEO: Redirect to Separate Domain

We just migrated a site from Craft 2 to Craft 3 and I'm running into an issue with some redirects we used to have setup in Sprout SEO. Our site runs a Craft CMS backend with a Nuxt frontend along ...
0
votes
0answers
20 views

How to redirect the page with params?

In the front-end, I create a form and submit the data to backend. In the controller, if got some errors, I would like to redirect to the previous page with some information. I tried like this: return ...
3
votes
1answer
19 views

Output values from all entries in a specific section EXCEPT those with a specific category id

Currently, this is NEARLY doing what I want except instead of the output being entries that do NOT have the id, it's output is ONLY the entries with the id. I'm not sure why, since I've included the '...
0
votes
0answers
14 views

How do I assign a language to all datetime outputs

I am building a german calendar and am struggling having one language throughout all datetime outputs. The website is set to lang = de but the outputs of the solspace calendar is still english.
2
votes
1answer
10 views

Pre-fill fields when creating an entry in CP

I am using redactor plugin for my field type and I want to use global values of the same field type to be used as pre-fill value when creating a new entry. Use case: Each year there is an edition of ...
1
vote
2answers
29 views

How to add Facebook pixel code to my website

How do I add the html code to the head of my website in Craft CMS? Do I need to install a plugin, or is there somewhere I can access the code?
0
votes
0answers
9 views

Craft isn't regenerating the image transform when the focal point changes

I've got a basic image transform in a template: {% set crop = { mode: 'crop', width: 560, height: 550, quality: 80 } %} <img src="{{ image.getUrl(crop) }}"> Once the ...
1
vote
1answer
15 views

Grouping entries by category - most efficient approach

I have come up with the following code to group entries by categories; {% set hotTubs = craft.entries() .section('newHotTubs') .orderBy('price asc') %} {% set hotTubsCats = craft.categories() ....
1
vote
1answer
17 views

Setting a default entry for the entry field

I have an entry field that is a selector tool for the page call to action at the bottom. I have a channel of four or five entries and I'd like one of them to be the default selection so it's one less ...
1
vote
3answers
34 views

What is the Control Panel URL?

The installation instructions say: "A few seconds later, you should have a working Craft install! ... If it was successful, Craft will redirect your browser to the Control Panel." My installation ...
0
votes
0answers
12 views

Commerce 2 PayPal Express — “No value passed to payment” error

I've cobbled together a combined payment screen that has both PayPal Express and Stripe forms visible, one above the other. Stripe works fine but PayPal errors with 'ppxo_no_token_passed_to_payment'. ...
0
votes
0answers
27 views

Large file upload, 500 server error

We've a Craft 3 site hosted with Digital Ocean (Serverpilot set-up) with the DNS routed through Cloudflare. The client has experienced issues uploading large ZIP files to (c140MB), returning a 413 ...
1
vote
1answer
17 views

Commerce discount promotions as a fieldtype?

I'd like to create an entry in Craft that talks about a new discount, and then choose that discount via a field (so a bit like you can choose an entry or a product). That way, should the parameters of ...
1
vote
1answer
13 views

InvalidArgumentException with composer

I need your help, please. At https://docs.craftcms.com/v3/installation.html#step-1-download-craft I have this instruction: "To create a new Craft project, run this command (substituting with the ...
0
votes
1answer
32 views

Craft 3 auto-creates sub-folders in assets. How can I prevent this?

I use Google storage for photos. The Google storage volume is mapped to a bucket's subfolder. Unfortunately these appear as subfolders in assets, along with a set of repeated folder structure. I did ...
1
vote
1answer
22 views

Best practices to name Matrix fields handles

About matrix block fields handles: should they be unique ? For instance if I have a matrix with handle galleryMatrix, than should I name my block galleryMatrixImage or just image? And than my fields ...
1
vote
1answer
16 views

Craft 3 plugin to import channel entries

I try to finish a plugin which imports data into my craftcms project. I already created a console based method/service, which I trigger/run in my shell. Inside my method(s) I receive data (XML or JSON)...
3
votes
1answer
20 views

Partial Dates within Craft

Is it possible to store partial dates? EG i want to create a document that covers a date range, sometimes that range could be Jan/2013 to JUN/2014 other times we may need it more specific EG 20/JAN/...
1
vote
0answers
22 views

Order entries by custom date field

I want to modify this query so that the dated entries are sorted in descending order on a custom field called 'startDate'. Have tried adding .order('startDate') to the end of the craft.entries(query)....
0
votes
1answer
19 views

Image Transforms not happening

Apologies if this has come up before. I did check but the previous post referred to version 2.x and was regarding a bug. I have set up 2 image transforms for images but nothing works. The assets ...
0
votes
0answers
59 views

Unable to upload files (mp4,MOV,pdf) to craft CMS

Need some help. All of sudden our Craft (2.6.2993) is giving major issues. Unable to upload any videos and pdf. However we can upload small size images. When the size of the image increase, its the ...
2
votes
1answer
13 views

Second Site Channel URL Route Not Working

I've set up a Resources section on a multi-site installation with the type of Channel. For Site 1 I've set the routing rule to be {resourcesParent.one.slug}/{slug} and for Site 2 I've set the rule as {...
1
vote
1answer
17 views

Craft Rules and Validation

Some of the changes in craft 3 have been killing me. I know Yii does validation using the public rules function. Here is a rules function I grabbed from the MatrixBlockType model. function rules() { ...
1
vote
1answer
19 views

Help needed for a simple form

I am trying to learn Craft and since I don't know how to create a form with one text area and a button. On the button press, I want to redirect to another html found in the template directory, I am ...
1
vote
1answer
20 views

Is it possible to pass a variable to an event?

I need to find out if there have been made any changes to the entry on successful save. Using events entries.onBeforeSaveEntry and entries.onSaveEntry seems to be a way to do it. Maybe. Can I pass ...
2
votes
1answer
15 views

saving user field type custom field - Failed to set unsafe attribute

I have tried to save a custom field of "user field" type which resulted in this error. "Failed to set unsafe attribute" code: $order->setAttributes(array( 'operatorUid' => Craft::$app-&...
0
votes
0answers
17 views

Rich Text field changes any Https link to Http

When we add a link inside a Rich Text field, and type the link as "https://.....", when saved it changes the link to "http://....." automatically. We need the links to remain as Https and not Http. ...
2
votes
1answer
19 views

Multiple Asset source question

I'm creating a new Craft 3 site and migrating a lot of content from a wordpress setup. I'm wondering if it is better to separate assets into more sources - thus reducing the number of files per ...
2
votes
1answer
23 views

Set a route for all requests within a plugin

I’m trying to use a plugin to set up a site route that will direct every page request to a special template. This is what I’ve set up in my plugin file. public function registerSiteRoutes() { ...
2
votes
1answer
22 views

Craft CMS 3 data structure advice for vehicle make, model, trim, year tagging

Hi i really would like some advise on best practices on setting up some data for my Craft APP. Most of my documents will be linked to vehicle make/model/trim/year. EG Audi A5 Sport 2009-2016 and/Or ...
1
vote
1answer
24 views

Contact Form Setup on Craft CMS

I am just getting to grips with Craft CMS and am finding the Contact Form plugin tricky to use. I have built a reasonable site structure, figured how fields, sections, etc work at a relatively basic ...
0
votes
0answers
17 views

Only allowing users to change their own profiles

I have added public profiles following an answer on this stack exchange and it works great, the problem arises when adding a "User Profile Form" which allows users to update their own settings. The ...
0
votes
0answers
9 views

Edit entry from section “B” when the front end of section “A” entry changes

Is it possible to edit an entry within a different section? I have a front end for say section “A” that pulls in a list of entries’ titles from a different section “B”. Is it possible to update an ...
1
vote
0answers
13 views

Use sequential numbers for entry slug

I have a channel where I need each entry's URI include the year and then a sequential number, like this: 2018/1/ 2018/2/ 2018/3/ 2019/4/ I have no problem getting the year, but is there a way to get ...
2
votes
1answer
16 views

How to get a Super Table relation in PHP?

The following code works great in a template. {% set priceProduct = currentUser.priceTable.relatedTo({ targetElement: product.id, field: 'product' }).one() %} {{ priceProduct.price }} ...
1
vote
0answers
30 views

Avoiding includeJsFile, includeJS from caching

In my template, I have an includeJSFile that loads properly on the first load, but disappears on subsequent loads. The includeJSFile is outside the caching tags, so I'm not sure why this is still ...
0
votes
0answers
11 views

Using Embedded Assets Plugin With Element API

When using the Element API, how do you go about using the Embedded Assets plugin? With a regular asset, in the API transformer you can pull out assets and include them like this: 'transformer' => ...
1
vote
0answers
17 views

Craft 3 Launguage Switcher by certain group

I'm working on the language switcher and have it working. The only thing is I want it to pull from group data-id=1 It's pulling from all sites because of the i18n to change the language name to it's ...
1
vote
1answer
7 views

Is it possible to add an entries field to recurring events that can be changed per occurrence?

An event in Solspace Calendar that repeats weekly should have an entries field, that can be changed per single occurrence. E.g. Tuesday’s evening class is usually tought by teacher A, except next week,...
1
vote
1answer
19 views

Save and login user in a Plugin?

How can I register and login a user in my Controller? I have tried something like this: $newUser = new User($userName, $userPassword, $userEmail); Craft::$app->elements->saveUser($newUser);

15 30 50 per page