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 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
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
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
Accepted

Send activation mail from front end

I'll focus on the "sending an activation email from the front end" part of your question, since that seems to be the crux of it: You'd have to write a very simple, custom plugin. For instant success, ...
Mats Mikkel Rummelhoff's user avatar
4 votes
Accepted

get post data after submitting User Profile Form for success message

Not possible – any input values added to your profile editing form (such as test in your case) will be included in the POST request to the users/saveUser controller action, but they won't actually be ...
Mats Mikkel Rummelhoff's user avatar
4 votes
Accepted

Using Craft CMS with Foundation 6 (for Sites)

Craft is completely "BYO HTML", so there is no magic in making Foundation work with Craft, unlike lesser CMSes that force their own HTML on you. Just add your stylesheet links and script tags to your ...
Patrick Harrington'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.5k
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

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
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

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,495
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,344
2 votes

Access data when posting to controller from front-end

Turns out the ajax library I was using was expecting the data to be passed in a serialized format: 'comment=' + comment + '&entryId=' + entryId + '&authorId=' + authorId With that as the ...
Trevor Davis's user avatar
2 votes

Front-end entry field validation problem

You'll need to make sure the entries title is set otherwise that will throw an error. You can do this using a field in your form or set it in the Control Panel to automatically be set using another ...
Luke Pearce's user avatar
  • 3,863
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
  • 551
2 votes

Using Craft CMS with Foundation 6 (for Sites)

Patrick is right that Craft let's you do what you wish in your HTML templates. I think it's worth adding a small distinction to where you store your front-end assets as there are two possible ...
Ben Parizek's user avatar
  • 13.5k

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