Joe Posted December 23, 2013 Posted December 23, 2013 Hi, I have a field on a public-facing page that can be edited (by logged-in users only). I haven´t yet succeeded in making it saveable right from there. Thank you!
Martijn Geerts Posted December 23, 2013 Posted December 23, 2013 Take a look at ryan's example, it's basic but works. 2
teppo Posted December 23, 2013 Posted December 23, 2013 (edited) In addition to that, if you really just need to save one field, you can always use $page->save("my_field"). Logic (change tracking etc.) behind it is a bit different, but it's also usually faster. Not that it would, in most cases, really matter Edit: by the way, it looks like Ryan's example is about creating new pages with a custom frontend form? If you want to edit one field of current page, it's a bit easier than that; no need to create new page etc. as you can simply set value from $input->post->my_field to $page->my_field and call $page->save() (or $page->save("my_field")). Don't forget to use $sanitizer, though.. Edited December 23, 2013 by teppo 2
Joe Posted December 23, 2013 Author Posted December 23, 2013 Thanks, Martijn, thanks teppo! So I´ll get busy looking at those. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now