Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hello KK,
I am trying to delete cloned pages programmatically at the front-end using the following code:
Code: Select all
...
<cms:set this_template_link=k_template_link 'global' />
<cms:if deletePgIsSet >

   <cms:set my_action="delete_page_<cms:show deletePgID />" />
   <cms:set action_nonce="<cms:create_nonce my_action />" />
   <cms:set validate_nonce="<cms:check_nonce action="<cms:show my_action />" nonce="<cms:show action_nonce />" />" />

   <cms:if validate_nonce >

    <cms:db_delete masterpage='events.php' page_id=deletePgID />
    <cms:if k_success >
    <cms:set_flash name='submit_success' value='1' />
    <cms:redirect url="<cms:show this_template_link />" />
    </cms:if>

   </cms:if>

</cms:if>
...


So far the deletion is happening as should but the flash message is not setting. I need the flash message to set a json output. Can you kindly hep me with what could be the cause? Thank you

NB: I did not use a form for the action
If you have a list of the pages where you want to select the pages to delete, you could probably tweak and use the solution here. You can delete the p[ages without any issue and without a cms:form tag in place. Nevertheless, you will need to use the cms:db_persist tag. You can delete the pages without even reloading the page.

Please let me know what do you think.

Regards,
GenXCoders
Image
where innovation meets technology
2 posts Page 1 of 1
cron