Skip to main content
9 votes
Accepted

Updating a user on the front end with Vue.js and Axios

Unlike Vue Resourse (if you've used it), Axios does not have a good way to emulateJSON on legacy servers or frameworks that do not understand submissions sent as application/json. Your data gets to ...
Selvin Ortiz's user avatar
  • 1,623
8 votes

Use Vue.js with Craft

I know the problem here is solved, but I thought I'd just leave a link to a pretty decent intro to using Craft and Vue 2.0 for future reference... Using Vue 2.0 with Craft CMS And specifically the ...
Steve Holland's user avatar
6 votes
Accepted

Live preview using Vue.js

Craft 3.2 introduces Headless Preview which works a treat with SPA's. Essentially Craft exposes tokens which you can forward on to subsequent Element API requests and Craft will do the rest. The ...
Cue's user avatar
  • 221
6 votes
Accepted

Frontend Form - Checkboxes cannot "all" be unchecked

Your code is correct but you need to add another line near the top: <input type="hidden" name="fields[volunteerPositions]" value=""> From the documentation: If you are including a ...
RitterKnight's user avatar
  • 6,582
5 votes
Accepted

How to output first segment title/channel name of entry?

Unless I'm misunderstanding, it should be as simple as: {{ entry.section.name }}
Mike Pierce's user avatar
5 votes
Accepted

How do I export search results as a csv?

You can just make link to a twig template to output a csv quite simply...just like any other template really, except it won't extend you layout etc. and will simply contain something like: {%for ...
Jeremy Daalder's user avatar
4 votes
Accepted

Front End Asset Management - Upload New Photos without Deleting/Overriding Existing

You're right that your template needs some adjustments. Whenever you're saving an Assets field, you need to have all of the Asset id's not just the new ones. You're looking for something like {% if ...
Andris Sevcenko's user avatar
4 votes

Override admin template with own template

For that path, Craft would look for the following template files, and use the first one that exists: craft/app/templates/users/_edit craft/app/templates/users/_edit.html craft/app/templates/users/...
Mike Pepper's user avatar
  • 4,391
4 votes

How can I add banner slider on my home page?

In Craft, you as developer are responsible for everything that is front-end output. So if you want a banner slider, you'll have to add a field on the entry where you can add images, and in your entry'...
mrsmn's user avatar
  • 731
4 votes

Users are always logged out on front end

I tracked down a similar problem, and documented it here: The Case of the Missing PHP Session I'm not sure if it'll address the issue you're having specifically, but it may give you some clue on ...
andrew.welch's user avatar
  • 11.6k
4 votes

“Request missing required body param” error when creating entry on front end

This was an unintentional breaking change. See https://github.com/craftcms/cms/issues/4693 Update: Fixed in 3.2.9, which is now (2019-08-06) available https://github.com/craftcms/cms/blob/develop/...
Andrea DeMers's user avatar
4 votes
Accepted

Add variable to twig context

So the way Twig works is that it populates a Twig Environment with a context of global variables. Then any time a template includes another template, the context is passed down to it. So if you want ...
andrew.welch's user avatar
  • 11.6k
4 votes
Accepted

How to create a follow system "button" for "Event" entries?

This functionality is comprised of multiple components – you need to build the interface, keep track of which visitor follows which events, potentially do something with that information and change up ...
MoritzLost's user avatar
  • 11.9k
4 votes

can't figure out how to embed youtube videos

This is, most likely, not an issue with Video Embedder, or Craft. I think you are most likely just seeing the normal behaviour of an iFrame. An iFrame, like any replaced element in html, is 300px wide ...
Seth Warburton's user avatar
3 votes
Accepted

Can't include relative JS file from layout

It looks like this is all happening in Craft's template folder, where anything with an underscore—like your _layout directory and its contents—won't be accessible via URL. You'll definitely want to ...
Matt Stein's user avatar
  • 4,006
3 votes
Accepted

Front end assets uploading, does not appear to be a an image error

The issue lies if you have a Preparse field in that field layout, see details here: https://github.com/aelvan/Preparse-Field-Craft/issues/23
Tim Kelty's user avatar
  • 3,081
3 votes

Live preview using Vue.js

Update: As of Craft 3.2 there is native support for headless previews. Please see Cue's extensive answer for a detailed explanation. Original answer I managed to do this, although I'm still not quite ...
Moritz Friedrich's user avatar
3 votes
Accepted

Front End Form with Dropdown in Matrix - Adding New

Your Code has two errors: 1. was missing. 2. The way you were fetching options was wrong. Here is the correct code: <input type="hidden" name="fields[emergencyContact]" value=""> <input ...
hashtagerrors's user avatar
3 votes

How to browse uploaded assets on the front end?

For Craft 3, there is UploadIt, a front end asset uploader.
Avant la lettre's user avatar
3 votes
Accepted

“Request missing required body param” error when creating entry on front end

Added an empty entryId-field to the form which apparently solves my problem. <input type="hidden" name="entryId" value="">
Marcus Scheller's user avatar
3 votes
Accepted

How get entries by sources in a frontend fieldlayout?

UIDs are not yet usable in queries. You would need to extract the UID of the section from the string then fetch the sectionId to use in your query. Something like this: {% for tab in entry....
Oli's user avatar
  • 7,515
3 votes
Accepted

What is causing Craft CP assets(JS/CSS) to appear in front-end pages?

those CP files are included by CpAsset asset bundle. if your plugin asset bundle depends on CpAsset: class YourPluginAsset extends AssetBundle { public function init() { $this->...
user9975's user avatar
  • 534
3 votes
Accepted

Help with Tailwind import

I'm not 100% sure, but I think you just need to point Tailwind to the directories/files where it should scan for class names - in your case this might be simply templates. Add this in tailwind.config....
James Smith's user avatar
  • 5,689
2 votes

Frontend form database error with empty Users field

Figured it out. If you want to return an empty Users field, the field name attribute has to look like this: <select name="fields[teacher]" value=""> But if you want to return a non-empty Users ...
Clive Portman's user avatar
2 votes
Accepted

Tags via AJAX actionTrigger

After some debugging I found, what I did wrong: I had for some reason the wrong groupID (checked that in the backend and DB) as well as title needs to be present in the passed data and is the name of ...
Eternal Black's user avatar
2 votes
Accepted

Simple category-entry search filter

This article was helpful getting us started when we tackled an advanced search. Though their example uses dropdowns, you'll probably want to use checkboxes for your "Herbs" and "Live Plants" ...
AbbeyDesign's user avatar
  • 1,527
2 votes

Issue with uploading files from frontend

Doesn't look like the field name is correct - you should be using the fields namespace for all the actual Entry fields. For the upload, for example, you should be using fields[useruploads]. You can ...
Andris Sevcenko's user avatar
2 votes

Issue with uploading files from frontend

Have you tried enabling devMode in the craft/config/general.php file? You can do this by adding 'devMode' => true to the array. You should then be able to see an error on submission. If this fails ...
Matt Shearing's user avatar
2 votes

How to implement radiobuttons field on frontend registration form?

Because radio inputs are a "single value field", meaning that when the form submits, only one value actually goes through, you don't need the extra [] array brackets at the end of each fields[] array. ...
Ryan's user avatar
  • 1,972
2 votes
Accepted

Use Vue.js with Craft

I found out that vue 2.0 is the problem. It's no longer possible to change the delimiter like that Vue.config.delimiters = ['${', '}'];. I found out on Github that it got reworked as a component-...
obs's user avatar
  • 591

Only top scored, non community-wiki answers of a minimum length are eligible