13 votes
Accepted

Is it possible to change a user's password in the front-end?

It is! To do so, they will have to be logged in and input their old password. They need the old password to change their email or update a password. Here's an example: {% macro errorList(errors) %} ...
user avatar
  • 1,818
11 votes
Accepted

Using Commerce to pay for posting entry

You will need to write a plugin with three responsibilities: Keep track of which entries have been purchased Set an entry to enabled when it has been purchased Ensure that entries always have the ...
user avatar
9 votes
Accepted

How to upload an asset from a front-end form

That's not going to be possible to do without a plugin. The plugin would need to provide its own Controller which does the following: Grab info about the uploaded file using UploadedFile::...
user avatar
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 ...
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 ...
user avatar
7 votes

Code for resending the activation email

I want to be able that users can enter their emailaddress in an input and that the activation link gets resend You'll need to write a plugin, which can generate activation URLs using the UsersService:...
user avatar
6 votes

Managing Frontend JS for Matrix Fields

I'll be flat-out honest; I didn't read through your code. Secondly, I think to set expectations when you say a matrix field on the front-end you'll need to understand it isn't going to look like what ...
user avatar
  • 4,696
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 ...
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 ...
user avatar
  • 6,467
5 votes

Code for resending the activation email

Go to the Users section of the Control Panel (mysite.com/admin/users/). Click on the user account that needs to be activated. Click on the settings cog on the right side (see attached image), and ...
user avatar
5 votes
Accepted

Loading an existing entries drafts in template/frontend

After doing some digging around I found the getDraftsByEntryId(entryId, locale) method of the craft.entryRevisions service that might help. The following should return the first draft of an entry. ...
user avatar
5 votes
Accepted

Login As User from Frontend

You can call it from the front-end, but it requires the currently logged in user to be an administrator. Just point the form's hidden action input to users/impersonate and have it submit a 'userId' ...
user avatar
  • 66.4k
5 votes

Error when submitting Date Field from the front-end: cannot be blank

The input tag presented in the comments above does not appear to use the correct input tag format for the date field. To submit a date field on the front-end, your input fields need to be setup with ...
user avatar
  • 13.2k
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 ...
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 }}
user avatar
4 votes

Has anyone converted a Bootstrap based website to Craft?

I built Progress.org using Craft and Bootstrap—and it only took me about two months of part-time work. I’d say Craft and Bootstrap together are a match made in heaven. Here’s why: 1) Bootstrap is an ...
user avatar
4 votes

How do I enable editing of entries with a front-end form?

Add another hidden input field "entryId" to your form. There's nice example code in the Docs: You can modify the form to save existing entries by adding an “entryId” hidden input to the ...
user avatar
  • 35.8k
4 votes

Entries retain field data that has been removed from entry type layout

Technically, all entries have all fields, regardless of their layout. Field layouts are mostly just a UI thing. 1) Is there a way to tell if an field is actually actively assigned to the entry ...
user avatar
4 votes
Accepted

How do I update the state of lightswitches reliably using checkboxes on a frontend user profile form?

While both lightswitches and checkboxes represent an on/off state, they are quite different. Standard browser behavior is designed to only post checkbox data if the checkbox is checked, otherwise it ...
user avatar
4 votes
Accepted

Enable the user to upload background Image

You can simply add it inline to your body tag like so: <body style="background-image: url({{ myGlobal.myAssetsField.first().url }})"> If you want to only use it with selected templates, you'd ...
user avatar
  • 35.8k
4 votes
Accepted

Allow users to change email address on front-end form

When I use my email field to attempt an email address change, I get a verification email generated by Craft sent to the new email address, but the email change is not reflected in either the CP or on ...
user avatar
  • 66.4k
4 votes

How do I retain form input values after submitting error-ridden form containing matrix field inputs

As you've discovered, your Matrix Field behaves a bit differently than many other basic fields. The Matrix Field, is composed of several Matrix Blocks and, like Entries themselves, Matrix Blocks are ...
user avatar
  • 13.2k
4 votes
Accepted

Log in as different users in backend front end at the same time?

You can use "incognito mode" in your browser, or you use another browser or computer for this type of front end testing.
user avatar
  • 35.8k
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 ...
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 ...
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, ...
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 ...
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/...
user avatar
  • 4,361
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'...
user avatar
  • 701

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