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
0answers
14 views

static site pipeline sync plugin does not produce artifacts

I'm trying to generate static sites from my Craft CMS. I've found the static-site-pipeline-sync plugin which seems to do exactly what I need. However, it does not generate artifacts despite the fact ...
1
vote
1answer
55 views

Change base URL for email activation link?

I am using Craft as a headless CMS and have set base Url/siteUrl to the url of my React/Gatsby site. I needed to do this as my navigation plugin, Navie, appends it by default. But now when users ...
0
votes
1answer
11 views

Is it possible to validate whether all assets in an entry have been uploaded?

Is it possible that all assets are uploaded in a single entry and display success or fail in a friendly way? Use case: Client uploads 2000 photos at a time in an entry and has to keep scrolling to ...
1
vote
1answer
39 views

Use Craft globals for CSS styles

Is it possible to pass a value from Craft global setting into a CSS/SCSS file? So for example I want to be able to allow the end user to customise colours and fonts without having to include it inline....
1
vote
1answer
31 views

alternative global variable to siteUrl or the primary website?

I am currently developing a multilingual craft website. To include assets like styles and scripts, I have so far built the URL following the pattern "{{ siteUrl }}/assets/css/main.css". However, as ...
0
votes
0answers
20 views

Freeform custom field import / export options

Does anyone know of any import / export options for fields built in Freeform? Ideally I would be able to build a bunch of custom fields and then export a JSON file, or some other file type (XMl) that ...
1
vote
1answer
148 views

Headless Live Preview with Gatsby

I am following Andrew Welch's post here - https://twitter.com/nystudio107/status/1168220713158942720?lang=en I used the gatsby-config.js file he shared here - https://gist.github.com/monachilada/...
1
vote
1answer
31 views

Craft 3 Cache Busting for Pending Entries

So in Craft 2 the following code was required to cache bust if an entry was set to pending or post at a future date. {% set firstPending = craft.entries({ section: 'projects', status: 'pending', ...
0
votes
0answers
13 views

Browsers “connection to the server was reset” every time i try to access “options” in admin in clean installation

Every time I try to access "Options" section of the admin, the browser shows a blank page and "connection to the server was reset". This error shows in firefox, and in Chrome shows "localhost no ...
0
votes
0answers
32 views

Yii2 2.0.31 in Homestead errors

I am getting the following error when trying to update Craft from 3.3.18.4 to 3.3.19 and any version after. It seems like Homestead or Vagrant is having some sort of issue with IpValidator or the ...
1
vote
1answer
32 views

Adding 301 permanent redirections in Craft CMS

I am not able to redirect any dead page. Although I have added the redirection but it is not getting reflected. Please help.
1
vote
2answers
54 views

Posting to plugin's action controller using Ajax + JSON

I want to use Ajax to POST to a plugin endpoint and get a JSON response. The plugin I'm using is for Mailchimp newsletter subscriptions and should allow for JSON responses: https://github.com/aelvan/...
0
votes
0answers
18 views

Outputting the order of an entry and the total of related entries

I have an item that has related entries to it. I want to output the position that item is within the related entries and the total of related entries also. e.g. 2 of 7 I've figured out how to get the ...
2
votes
1answer
40 views

Craft 3 FeedMe - Help accessing deeper XML nodes

I'm importing data from an XML file. I'm having trouble accessing some of the deeper nodes in the xml file. Example of my xml here (chapter being the repeating item): <article xmlns="http://...
1
vote
1answer
27 views

Avoid saving $_POST in Craft logs for certain URLs

We know that Craft logs the $_POST variable in web.log. I wonder if we have some sensitive data going through the server side (collected from a front end form), even if we don't save it in the ...
0
votes
0answers
15 views

$PATH variable location for backups

Folks: This is surely something real basic. I have not been able to create a database backup manually or when updating. Mysqldump is installed. I know the location of mysqldump (/usr/local/bin/...
1
vote
1answer
59 views

How does Craft CMS cache with Redis?

I don't understand how Craft CMS processes cache with Redis especially when saving to database/s? My environment: Craft Pro 3.4.8 PostgreSQL 12.2 PHP-FPM 7.4.3 Redis 5.0.7 I followed examples from ...
1
vote
0answers
75 views

Check if entry type has field

I can't seem to figure out a good way to see if an Entry has an actual field defined. All the examples I see just to a falsy check for the property name, but this might fail if you have previously ...
1
vote
1answer
70 views

How to return custom fields in GraphQL

This is definitely a noob question, but I can't seem to find an answer to this. (Completely new to GraphQL). I'm trying to simply return entries: query test { entries(section: "vacancies", limit: ...
0
votes
0answers
10 views

Log setProgress in external class

I'm running an import of some articles. But when I'm executing the job, I'd like to set the progress and show some explanation in the label. But as I like to keep my code as clean as possible, I have ...
0
votes
0answers
15 views

postLoginRedirect paths for multi-site scenario

When using settings like postLoginRedirect or loginPath in a multi-site scenario, is there a way to way to define different paths for each site? Or would the path defined be used for both sites, just ...
2
votes
2answers
23 views

Is it possible to allow logging at LEVEL_INFO without logging all the SQL queries?

We're currently logging our site at LEVEL_INFO to have a good idea of what's happening on the site. We find it useful, and appropriate, to log informational messages at that level rather than at ERROR ...
2
votes
1answer
25 views

BaseURL field not available

First time I install CraftCMS and during the wizard as well as in the Control Panel the fields for BaseURL are displayed like this: I got passed the wizard by using the comand line tool but now can't ...
0
votes
0answers
25 views

Update category selection in user custom fields

I have a Category "Colors". This category has: Blue, Red, Green I've added a custom users field (CP > Settings > Users > Fields), this field is the category type. "Colors". In the front of website I ...
1
vote
1answer
54 views

how to check for the 2nd, 3rd, 4th… image in an asset's field

I am currently "translating" our current website, which runs on the lastest expressionengine, to craft. we use imagegrids that are arranged by css. so in an entrie's pulldown field choose between ...
0
votes
0answers
17 views

Undefined this.$overflowTabBtn.data(…) initTabs Craft.js:11326:51

I'm getting this error on one Solspace calendar (2.x) event entry form, but not another. The only difference seems to be two asset fields, and one entry reference field. It's the only page the error ...
1
vote
1answer
54 views

PHP warning with composer on MacOS Mojave: Failed to open stream: No such file or directory

I am working on a plugin in Craft:3.4. I get this error while trying to install the plugin in the CP. yii\base\ErrorException: include(/app/vendor/composer/../wittsstratts/craft-company/src/Company....
1
vote
1answer
15 views

Available Shipping Methods Returns Null

I have created a shipping method in the CP but when I output cart.availableShippingMethods a null value is returned. I've checked my database and the shipping method is there. Is there something I'm ...
0
votes
1answer
67 views

Craft CMS development licensing issues

I have a Craft CMS installed in a development environment thewebsite.test. I can't get it to trial paid plugins and Craft Pro. It appears Craft doesn't recognise it's in a development ...
0
votes
0answers
19 views

Feedme asset import is looking for slugified filename not real filename

I'm trying to import json data from a legacy system into new entries and there are files associated with them. I've put all the files in the assets dir and run "Update assets index" so they show in ...
1
vote
1answer
36 views

how to output all images in an entry's loop

Unfortunately I'm still very new to Craft, but I have a question to which I haven't found an answer here or in the Docs or the ones I found don't seem to work in my case. I want to output all the ...
0
votes
0answers
9 views

Applying multiple shipping rules to priceForOrder

I would like to apply two shipping rules to my orders. 1) add 5% 2) add a fixed cost based on weight per gram Currently my method.priceForOrder is only applying the 5% rule. Is this possible?
0
votes
0answers
20 views

Jobs instantly fail when initiated but then always work when I click retry from Queue manager?

So this happens whenever I run a job whether its a feedme or update asset indexes job. The jobs don't even run they just fail instantly but then when I click retry from que manager they run and work ...
1
vote
1answer
15 views

How do I store and retrieve elements for ElementSelectField? Getting error “Call to a member function getUiLabel() on array”

I have a field that allows a user to select multiple products and save them to the database for a plugin, but when I try to retrieve these values and have them selected in my form I get the error ...
1
vote
1answer
31 views

Entry UrI Format and ternary operators

I tried setting up a URL format that takes the hierarchy of a structure into account, but deals with the magic __home__ slug transparently. So I did this: {parent.uri == '__home__' ? '' : parent....
1
vote
1answer
25 views

Cannot call service: “'MyPlugin' not found” error

I'm sure this is a trivial mistake but I can't figure it out (first-time plugin dev). I have my plugin running with all code in the controller and want now follow best practice and move the workhorse ...
0
votes
1answer
24 views

Is it possible to change admin Actions URL (not only the URI)

When Craft is in headlessMode my URLS for admin actions (ex. /admin/set-password) are set to the frontend URL (SITE_URL) instead of the Admin URL (SITE_ADMIN_URL). Is this behavior as expected? As ...
1
vote
1answer
17 views

Text cut off after migration in some fields

I migrated a site from Craft 2 to Craft 3 and on some Redactor fields, half the text is gone. It looks completely random. In some fields, the text is gone. In some the text is about half as long as ...
1
vote
0answers
10 views

How to apply sales to custom order adjustment?

Is it possible to apply a discount voucher to custom order adjustments? EG i want 5% off everything. I have two order adjustments, one is rush delivery and the other is an engraving fee. At the ...
1
vote
0answers
33 views

How to save dynamically created checkbox values in plugin settings?

I am in the early stages of developing a plugin for Craft 3. In its settings it should have a checkbox for each section the user has defined that enables the admin to select or unselect each section ...
1
vote
1answer
44 views

How to filter the plugin store by price

We have a tight budget for a new Craft 3 site. How can the paid plugins be filtered from the store, so we can review only the free ones?
1
vote
1answer
58 views

Trouble updating Craft when allowAdminChanges is false

I've just updated a multi-environment site from Craft 3.3.5 to 3.4.5. Here's our config/general.php (irrelevant bits removed): return [ '*' => [ 'allowAdminChanges' => false, ...
1
vote
1answer
49 views

Sprout Forms - Notification Based on Checkbox Value

I'm using Sprout Forms 3.8.0.2 and Craft CMS 3.4.5. My client wants the email notification to go to different email addresses based on whether or not a form checkbox is checked. My plan is to create a ...
0
votes
0answers
15 views

Automatically replace strings in different language

We have sites for Germany and Switzerland that are pretty much identical but would like to cater to the spelling differences in Switzerland (namely replacing "ß" with "ss"). Is there any way to run ...
1
vote
1answer
9 views

Getting adjustment amount in a plugin

I need to get the amount of a discount from orders to write that data into a json file (on EVENT_AFTER_COMPLETE_ORDER) which then will be consumed by an inventory management system and now am stuck ...
0
votes
1answer
35 views

How do I change the /web directory?

I'm extremely new to Craft CMS - I'm trying to install it on to a Cpanel as a test, upon downloading the CMS is gives you all the folders for craft, and then a separate /web folder. If you move the ...
0
votes
0answers
25 views

Images won‘t display in an entry loop

Unfortunately I'm still very new to Craft, but I have a question to which I haven't found an answer here or in the Docs or the ones I found don't seem to work: Why doesn't this entry-loop output a ...
0
votes
0answers
46 views

Editing a users custom fields from a plugin action Craft 3

Does anyone know if there is a block on updating users form an action? Trying to update a users custom field in craft 3 via plugin in the admin. The admin template calls an ajax call to the action ...
1
vote
1answer
62 views

How to get the hash/anchor in the URL?

I am using an entry's slug as the anchor for a page. How do I grab the anchor from the request? For example I want to get #article-one from /blog/#article-one If it's not possible, is there a way ...
0
votes
0answers
46 views

Craft CLI not working

I am getting the following error when I try to execute ./craft help Exception 'yii\base\InvalidConfigException' with message 'Failed to instantiate component or class "modules\Module" How do I fix ...

1 2
3
4 5
30