Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
I think the subject says it all.

To make seeing results easier on the backend, I'd like to programmatically set the folder for newly created pages via DBF. I haven't simply tried it, believing it would fail, because I have found setting 'k_' variables to fail.

Am open to any solutions to the problem of how to create a page already within a folder from the frontend. Making my own editable doesn't work, not at least without rewriting the backend UI myself, and I am not interested in doing that at this point.

I am happy to initially create the folders first manually, although dynamically creating folders from the frontend would be a useful trick, too.

Just hoping! CouchCMS is so amazing, I can't complain about a thing.
Hi,

While it is currently not possible to create folders using DBF, we can certainly set the folders of pages being created this way.
Here is how -
Code: Select all
<cms:db_persist_form
    k_page_folder_id='32'
/>

The parameter to use is 'k_page_folder_id' and it expects an integer as the folder's ID.

If the folder's ID is not available, you can use the following to get the ID from a folder's name (assumes the folder's name is 'silver' and the masterpage defining it is 'members.php') -
Code: Select all
k_page_folder_id="<cms:folders masterpage='members.php' root='silver' depth='1'><cms:show k_folder_id/></cms:folders>"

Hope it helps.
Awesome!!! And, I thought I was going to have to learn to use the new hooks you've added for interaction with the core. I love how easy it is to do what you need to do. The more I use CouchCMS, the more I love it. :D
3 posts Page 1 of 1