Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hi, I had a quick question if anyone can offer assistance.
I'm creating a "task manager" type app. I've completed most of it, and I've managed to keep most of the administrative functions on the front end, so that users will not have to access Couch to use the app.
One thing I can't figure out, can a databound form create a folder? So all the tasks are in folders, and the user selects a folder when they are creating a new task. Ideally I would like to have another option to create a new folder, rather than use the existing ones.
I am using dynamic folders, and extended folders (to assign a color to each folder), which is maybe complicating matters.
I suppose I want to know if this is possible, and a wee hint on the code if possible.
Thanks in advance!
Ewan
Not possible with db_persist (viewtopic.php?f=4&t=9831#p22386).
Use raw PHP (preferably write a custom cms:func) based on the KFolder::save method found in couch/folder.php.

Sorry I couldn't be more helpful. 8-) I used to work around this issue by using related cloned pages instead of folders. If your app doesn't need an admin to log in to Couch to set pages in a folder, this could be your best choice. Relations can be handled with db_persist quite natively. It's all the same in frontend :)
@trendoman,
Not possible with db_persist
That actually changed with v2.0 - viewtopic.php?f=5&t=8803&start=10#p27845
I think the solution provided in the mentioned post should help with OP's use-case.
Hey trendoman,
Thanks for the quick reply. That's pretty much what I thought would be the case with db_persist - but always best to check. Related cloned pages are probably the best way to do this then, I'll give that a go. Writing a function with raw PHP would be nice, but would probably take me far too long, and no-one is paying me to do this :)
Thanks again!

Edit:
Just noticed your post KK. Thanks! That looks interesting - I'll need to take some time to figure out exactly what it's doing.
@KK, true, I had it bookmarked. Does db_persist invoke events, associated with folders?
Does db_persist invoke events, associated with folders?

The admin-panel uses regular db_persist_form for managing folders - so I think all events available there should also be available elsewhere too if we use db_persist_form/db_persist.
6 posts Page 1 of 1