I need to delete some item based pages from frontend. Can I do this without messing up the database? I figure there may be relations that will fail if not done properly.
I'm basically doing this in my template:
I found that deleting just the item like this leaves behind the page to which it was previously attached. Opening the page then results in an error, since the PAGEITEMID now points to a deleted reference.
I can also grab the pageid related to that item and do this:
Will this be sufficient or am I messing up the database?