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
2 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
3 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
3 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 ...
0
votes
1answer
8 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
19 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
11 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
21 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
10 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
31 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
20 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
40 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
24 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
23 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
53 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
10 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
14 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
12 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
85 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 '...
0
votes
0answers
14 views

Overwrite Matrix data programatically and save

I'm working on a translation plugin. Now I want to translate fields in a matrix and save it to the right site (language). This plugin is called in a after save event. It gets the value of the Dutch ...
1
vote
1answer
19 views

Why is it when I update an entry within a structure in the admin, it reorders it to the bottom of the list?

I've created a structure and I have about 15 entries in it. They are grouped under an entry named "0234" and each entry below it is named 0234 A, 0234 B, 0234 C, etc. I would like to keep ...
1
vote
1answer
36 views

Localization Section propagation settings, and related entry field setting “Manage relations on a per-site basis”

Craft 3.4.20. Site is running multiple localizations Sections: Blog Post Propagation method set to, "Save entries to all sites enabled for this section" Blog Category (Structure entry with ...
1
vote
2answers
38 views

How to use entry data?

My question: How can I use entry data in the craft backend? An example for the use-case: Author creates an entry for the section "Generate item". The entry has only a title/single word. ...
1
vote
1answer
25 views

Get field type in templates

I need to get the field type in my templates like I used to do: field.getField.type but that does not seem to be working in Craft 3 anymore. The result is always null. It also seems that the »type« ...
1
vote
1answer
19 views

How to auto enable a plugin after install?

I am developing a plugin for craft 3 and the plugin just got published to the store. I can browse through the store and install the plugin but it stays disabled. The user will have to goto Settings -&...
1
vote
1answer
17 views

Where can I set how the pagination links render?

I have inherited a Craft 3 project in which the pagination links render with a query parameter "page": https://mysite.com/blog/?page=2 but this makes crawlers like HREFS to ignore the Next ...
1
vote
1answer
26 views

How to define table attribute in the record file

Following code is working on Craft 2: class My_TableRecord extends BaseRecord { public function getTableName() { return 'my_table'; } protected function defineAttributes() { return [ ...
1
vote
1answer
16 views

Controller redirect not working in craft 3

I am working with Craft 3 and in my controller, I am trying to do this $this->redirect('https://foobar.test'); But it is throwing me back to the root url of my craft site. I am confused, what else ...
1
vote
1answer
29 views

I am trying to have a vertical tab with hidden content

In Craft 3, I am trying to build a vertical tab categories using href=#sample and the hidden content id=sample. I am using bootstrap JS as my library. Here is the code I use. I somehow not managed to ...
0
votes
0answers
19 views

Control panel search on frontend

How difficult would it be to replicate the control panel search on the frontend of a Craft site? I currently have a standard Craft search as shown in the documentation but it's a little slow as I have ...
1
vote
1answer
23 views

How to get my craft projectConfig settings inside JS on the front end

So I am trying to work with twig templates and I want to inject my project configuration in my js so I can use it. I can do this {% set admin_email = craft.app.projectConfig.get.email.fromEmail %} ...
1
vote
1answer
24 views

Get entry by language in a module

I'm trying to get some auto translating done in a craft module. In order to do this I need to get the entry of another language in a save event. Is it possible to get this by language? Event::on( ...
1
vote
1answer
20 views

What is the best way of managing multisite propagation post setup phase?

I have a multisite setup with a pages section. In the future we want to add additional sites but there seem to be some caveats. When we first setup pages we set the section propagation to 'all other ...
1
vote
1answer
18 views

Register custom REST routes while building a plugin for Craft 3

I am building a custom plugin for Craft and I am hitting some REST APIs in my backend service to fetch some data using Ajax calls in JS. What I would like to do when the AJAX calls complete and come ...
0
votes
0answers
20 views

How to write multiple operator condition in where statement of db query

$query = (new Query()) ->select([]) ->from(['{{%custom_table}}']) ->where(['<=','firstDate', now()]) ->all(); In craft3, I want to add multiple ...
1
vote
0answers
38 views

Test Craft Plugin without the use of a database

We'd like to add Unit Tests to our Craft Plugin. I have used the Plugin Factory generator to generate the files and the basic setup seems to work. I am however struggling getting the tests to work ...
0
votes
0answers
32 views

How to automatically set time in a date/time field?

For a specific kind of entry I need the time in a date/time field to either automatically display as 23:00/11pm on the user dashboard, or, permanently set the time on that date/time field to 23:00/...
0
votes
0answers
19 views

Is it possible to get a users most popular categories based on Craft products?

So i wanna show the user the product categories that is most popular for that spesific user. Is that possible?
1
vote
1answer
56 views

Work with data/content from entries

I'm usually working on Backends with PHP and ZF/Laminas. Now I'm building a headless (only Backend) Craft CMS website and have a couple of questions that I didn't find a clear answer on. The Craft ...
1
vote
1answer
33 views

How to use createFromString() in Craft 3

In Craft 2 I've used createFromString() as following: DateTime::createFromString($pubDate, craft()->timezone) But if I use this function in craft cms 3 then I'm getting the following error: Call ...
2
votes
1answer
25 views

Unavailable plugin during migration to craft 3

During a migration from craft 2 to craft 3, I stumble in 3 issues with plugins. Plugins are not available in craft 3. For example,"instablog" plugin Reinstall paid license plugins. Custom plugins. ...
1
vote
1answer
37 views

Checking which version of Craft CMS a site is using

I've been asked to look at Craft CMS site where my would-be client has been ghosted by his previous developer. I have no handover information and only FTP and phpmyadmin access presently. Looking ...
1
vote
1answer
16 views

Output specific entry from entries field based on position

I have an entries field in a section, I am looking to output a certain selected entry from this field based on its position. For example I want to out the 2nd or 3rd entry only from this entry field, ...
0
votes
1answer
24 views

Is this level of server CPU usage normal? Solspace Calendar 3

Digital Ocean graphs are below to see what I am referring to but it seems like this plugin is using an inordinate amount of power for what it is doing. As far as I can tell it is directly related to ...
1
vote
3answers
40 views

How to add content to pages using a plugin?

I am developing a plugin for Craft 3. And I am trying to add some content to all pages in the CMS using this plugin. How can I do that? Is there a method or class call I can use for this? I am not ...
1
vote
1answer
11 views

Images not showing even after bundling them with asset bundle

So I am trying to build a simple plugin for Craft CMS and I am wish to use my assets in the twig template like css, js, images etc. From what I have read and understood from Asset Bundles, I have ...
1
vote
1answer
12 views

Show a list of pages but hide the current page from the list

My setup I'd like to show a navigation menu listing all my page entries. In my layout file, I include a template for the navigation: _layout.twig: <main> <section id="nav"> ...
0
votes
0answers
12 views

Plain text fields defaulting to curly quotes in editor

I’m running into an issue on my Craft install where plain text fields are automatically being styled with fancy quotes within the backend, particularly in cases of opening and closing quotes. It does ...
1
vote
1answer
21 views

Have SEOMatic render a custom SEOMatic field

I've got a few pages on my site that are not content managed. I don't want to create entries for these pages, but I do want the SEO for these pages content managed. My solution here has been to set ...
1
vote
1answer
21 views

How to use assets while building Craft CMS plugins?

I am trying to build a basic plugin, when installed has a single nav bar item, and of course a twig template which shows up on clicking on that navbar item. I have used the basic template to extend ...
1
vote
1answer
18 views

CraftCMS Redactor is adding <p> tags to viewable source code… but then removes them when saving

We are in the midst of a migration from WordPress to Craft. Much of the content contains line breaks, which are converted to <p> tags in Redactor (as seen in Redactor's view source plugin). ...

1
2 3 4 5
31