Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
1answer
12 views

query on Super Table field's date field

I have a section (events) with a Super Table field that has a date field. I am looking for a way to make a request to have the events superior to now. I cannot find how to do it. The event have ...
1
vote
1answer
23 views

Ajax Load more Posts

On my blog i need a load more button on the bottom of each section that simply loads more posts when clicked. Everything i look at people are using other javascript libraries. I just want to use ajax ...
0
votes
0answers
12 views

Ajax search depending on user

So i need to implement ajax with my search, basically auto populating as you type. I need it to auto populate entries, channels and structures. However i need to ONLY show certain results if the user ...
1
vote
1answer
20 views

404 page title SEOmatic

404 page doesn't have a title. It shows "| Sitename" in my case. I'm using Craft 3 with the SEOmatic plugin and would like to set the title in the 404 template. {% set seomaticMeta = seomaticMeta | ...
1
vote
1answer
20 views

Upgraded to Craft 3 and lost my Commerce Gateways

I upgraded to Craft 3 and I went to my payment gateways and I have the old ones in there with no details such as keys. And my only gateway options are Dummy and Manual. I know there were changes such ...
1
vote
1answer
23 views

Entry URI format with postDate not working

I have a News channel that's looped on an 'News Index' template. Each news entry is linked to its respective link via {{ entry.url }}. In my News channel settings, I have the entry URI format to be ...
0
votes
0answers
19 views

Custom Email Templates

I need to create a couple of custom HTML Email templates for some of my forms. Most of the documentation i've found doesn't really help me figure out what i need to do. Has anyone done more than 3 ...
1
vote
2answers
54 views

Where should the .all() be placed in Craft 3

I'm confused, I have ended up with 2 similar queries in a template after converting them from Craft 2. {% set events = craft.entries() .section('events') .eventDate('>' ~ now|date('Y-m-d H:...
0
votes
1answer
31 views

How do I restore a site from backup

I broke permissions in a critical craft install. My solution was to install a new version of the craft, move all of the templates from the old site to the new site and restore the MySQL database. ...
1
vote
2answers
120 views

How do I use offset in Craft 3?

In Craft 2 I used: {% for image in entry.imageGallery.offset(1) %} to exclude the first image, as that is shown higher up in the template. I get the depreciation error of: Looping through element ...
1
vote
1answer
18 views

Translating Craft form error message labels

I am trying to change the label for Craft's form errors. My site local is currently fr_CA, and when I try to submit a form with an error, the error message returned is in french, but the label of the ...
1
vote
0answers
13 views

Complex shipping logics

In Craft Commerce 2, we have two shipping categories: PostNL, which is one of the Dutch main shipping methods, which we use for packages that fit in the mailbox. For this category we use the weight ...
1
vote
0answers
27 views

Craft 3 Custom Plugin: model validation

Struggling a bit here - have created a custom plugin where I want to validate form submission against a predefined model before saving to the database. All pretty straightforward so far … However, if ...
1
vote
1answer
24 views

How do I differentiate between entries after merging an array?

I'm trying to plot entries from two different Solspace Calendars and an Entries section on one map, and use different markers for all types. Alll of the events are related to the current Entry through ...
1
vote
1answer
20 views

How to get the previous or next two entries

I have an entry which needs to display the previous two entries, and the next two. I see in the docs there's a nextSiblingOf method. That does nothing in a channel, and in a structure it will only ...
0
votes
1answer
14 views

Removing “action” from a module's route. Is it possible?

I have a module with a route that looks like this: http://localhost/actions/module/controller/action Is it possible to set up a custom route within my module so I can send people to: http://...
1
vote
1answer
23 views

Clear template cache from the CLI?

I was looking for a way to clear the “template caches” and “compiled templates” from the CLI, as I want to automatically do this after every auto-deploy of the site I've created. For this I was ...
3
votes
1answer
37 views

Get related posts excluding current post in Craft 3

In Craft 3, I’m trying to get the five most recent other posts sharing a category with the current post. I got this far: {% for relatedPost in craft.entries.relatedTo(entry.newsCategory).limit(5) %} ...
0
votes
0answers
24 views

Dukt Twitter Feed - Invalid Callback URL

I seem to be getting an error when trying to connect to my twitter app using Dukt twitter feed. When I click 'connect' I get the following error: Received HTTP status code [403] with message "...
1
vote
1answer
20 views

Close bootstrap row and start a new row Matrix

I need to figure out how to close out the columns if it equals 12 and then open a new row. I have a Matrix field set up with rows, but it needs to break with a new row if the columns equal 12. Any ...
1
vote
1answer
28 views

“Template Not Found” error when trying to access a module controller action

I'm a total Craft newbie, so I hope this question isn't ridiculous. I just want to see a controller / action work in my new module. I have src/controllers/ScrapeController.php as such: <?php ...
0
votes
1answer
29 views

Upgrading C2 to C3 - TypeError: Argument 1 passed to craft\helpers\StringHelper::toLowerCase() must be of the type string [closed]

In the middle of upgrading a C2 site to C3. Everything went fine, including the step where you visit the control panel to complete the update, and now I’m at the login screen. But when I try to login, ...
1
vote
1answer
22 views

Is there a safer way to Cycle Through Post Data in Craft

Currently, I am doing this. $responses = array( "E" => 0, "I" => 0); foreach ($_POST as $key => $value) { if (strlen($value) == 1) { ++$responses[$value]; } }...
2
votes
1answer
22 views

Plugin Store install buttons are not visible

I'm just working on a dev site and my Plugin install buttons are gone. I'm not sure how long they've been gone either, I don't really know where to start to debug it. No errors in the console and I ...
2
votes
2answers
23 views

Tons of Deleting Stale Template caches

My task queue (is that what it's called?) is filled with literally hundreds of "Deleting Stale Template Caches" and every day there seem to be new ones. Along there are also resaving entries tasks and ...
1
vote
1answer
40 views

Template loads via jQuery .load(), but no {% js %} tags are included

Inside of a modal window I'm loading a form template via jQuery .load. For reasons I don't know, the {% js %} tags that need to come with the form template are not being loaded, even though the {% js %...
1
vote
1answer
21 views

Get and Set existing matrix field data in a plugin

I have a plugin that wants to set a value for an entries existing matrix field, from a form on the font-end. Think of it like: Movies (matrix field) Movie (matrix block) Name (plain text) ...
2
votes
2answers
26 views

Getting products with Craft 3 and Craft Commerce 2

I've never had success using Craft 3 with Commerce 2 beta. I always get an error that ".find()" is not recognized, and ".all()" doesn't work either. My latest attempt has given me this error: Twig ...
0
votes
0answers
19 views

Craft 3 index template cached, cannot update.

So just added craft 3 on a server. I have a layout template for my head, footer etc., index template set as homepage, and a 404 page. No matter what I do, the index template will not update. The file ...
0
votes
0answers
14 views

Cloudinary video support

Has anyone found a way to integrate Cloudinary video into Craft 3? Similar to https://github.com/timkelty/craft3-cloudinary but for video. Below was excellent in Craft 2 https://github.com/...
2
votes
1answer
26 views

Running module migrations

I must be missing something or not understanding something. I'm trying to build a module for an install, and I'd like to run the initial migration. So the module initial install migration for the DB ...
2
votes
0answers
25 views

Track downloads on assets

I need to figure out if there's a way to track the amount of times an asset was downloaded. I need to display this in the back end on the site. I don't need to display it anywhere but on the back end ...
1
vote
1answer
38 views

Can't update past 3.0.15

Here's what I'm getting: Error: An error occurred Output: Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set ...
0
votes
0answers
14 views

Custom Structure Templates

I need to create custom structure templates for at least 5 articles. I would rather just be able to use the routes and tell it to point to the correct layout if the URL is whatever but it doesn't seem ...
2
votes
1answer
23 views

Sprout Forms - Can't save front end entry edits

This this might be a bug but want to ask here first in case I'm missing something minor. Description Trying to front edit a Sprout Form entry that was created in the front end. I'm using the same ...
0
votes
0answers
13 views

Error while creating or changing users

When I'm creating a new user in Craft (vs 3.0.18) or edit an existing user where I have to give my admin password, this error occurs: This action may only be performed with an elevated session. ...
2
votes
1answer
18 views

{% paginate %} Tag issue, no prevUrl / nextUrl Data

I have problem with the {% paginate%} tag. Setting: Craft CMS 3.0.18 Channel with 3 Entries -> handle "newsBlog" {% paginate craft.entries.section('newsBlog') as pageInfo, pageEntries %} When i ...
1
vote
1answer
29 views

How to render a template from within a module?

I'm currently developing a module that contains a custom field and I'd like to create a template to be used in the getInputHtml method. I try using the Craft::$app->view->renderTemplate method ...
0
votes
0answers
16 views

two forms on email

I have two forms collecting emails, one that signs up the user to use the site and then the other that downloads content. What i want to figure out is if a user doesn't sign up for the site but signs ...
3
votes
1answer
37 views

Getting full native language name in Craft3 language switcher

I'm porting across a multilingual project from Craft2 to Craft3 and have to rebuild the language switcher. I was previously using the .nativeName method but apparently this is deprecated. I've got a ...
2
votes
1answer
23 views

Limit not working

I'm trying to show the next post that's not in the array of articles "completed". I have the next articles showing that haven't been completed, however i can't set a limit to just show one article. ...
2
votes
1answer
33 views

How can I show a list of product options as checkboxes in the cart?

In my cart (Craft3/Commerce2), I need to show a line item's possible options from a checkbox field called "productOptions", and allow the user to select the desired options. Based on the Craft Docs, ...
1
vote
1answer
29 views

frontend account edits

I have an account page for all my users, however i'm running into a small issue with being able to update passwords / emails on the frontend. Any advice on how to do this? I read that updating either ...
0
votes
0answers
16 views

Paginate through structures entries

So i have pagination on each section on my site. What i can't figure out is how to navigate to the next section if it's the last article in the section. Any ideas?
2
votes
1answer
19 views

Is there a way to check if entry is selected in relationship?

This project has a lot of user stuff. I need to display display different sections based on if the current user is in a field. Is there a better/faster way than looping through and checking if every ...
2
votes
1answer
20 views

Ajax not updating user image

I have ajax submitting my form everything works except the user image. It works without ajax but not sure why it's not working with ajax. My ajax is and form are shown below. <form method="post" ...
2
votes
2answers
47 views

Contact Form sent via Ajax with file upload returns 302 instead of 200 status code

I’m using the Contact Form plugin to submit a form that can also upload files via Ajax. The problem ist that instead of a success (200) I get a status code of 302. But I receive the resulting mail ...
0
votes
0answers
35 views

Unable to call a service method from controller in my custom plugin

I know there are similar questions here, but I don't see a definitive answer, nor one that works for me. I've generated a plugin via pluginfactory.io, which has some controllers and a single service. ...
2
votes
1answer
26 views

Display Backend User Entries on Front end

I have the user submitting to a function that adds entries to a field called completed. It basically adds entries to each user showing the admin who has completed what. I'm trying to figure out how ...
1
vote
1answer
38 views

Craft Commerce 2 — Remove Line Item (and other actions)

Knowing that all other actions besides update-cart has been deprecated I'm curious what needs to be passed with the action to remove a line item from the cart using a button as opposed to check a ...