I need to create an entry from my UI after the user triggers a particular event on the page.

I want this to happen automatically and not rely on the user to submit a form.

Is there a way to create an Entry from a twig template (i.e. by calling the required controller function)? If not, is there an existing plugin that could work?

My content structure is something like this:

mySection = name of Channel that the entires will belong to.  Has the following fields:

myField1 = number 
myField2 = text 
myField3 = number
user = craft user field (relates the entry to an appropriate user)

I was hoping I could set those variable and call some sort of submit/save function to create the new Entry.


The only way to do this is asynchronously with javascript. If you already have an interactive event on the page I'm guessing you are using JS already? If so you just need to submit a hidden front end form alongside the CSRF token.

  • cool! thank you. I figured that was the only way but started 2nd guessing ... will do the form method for now and then build a plugin later. thanks for answering.
    – Erant
    Oct 22 '19 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.