Gallery Extended 2.1 Delete
You can place the {exp:gallery_extended:delete} tag in a template. Point a url to that template with a gallery_entry_id appended to the end of the url and GX2 will delete that entry from the database. You can pass a parameter to the function to also delete the image file from the server.
{exp:gallery_extended:delete}
Parameters
delete_from_server
{exp:gallery_extended:delete delete_from_server = "yes"}
The 'delete_from_server' parameter tells GX2 to not only delete the database entry for the image specified, but also delete the image from the server.
gallery_entry_id
{exp:gallery_extended:delete gallery_entry_id = "5"}
You can hardcode the entry id of the gallery entry to be deleted with this parameter.
Variables
message
{message}
The 'message' variable will be replaced by the appropriate message generated by GX2 depending on the outcome of the delete action.
Conditionals
failure
{if failure}{/if}
The 'if failure' conditional will show its contents if the delete action fails for any reason.
success
{if success}{/if}
The 'if success' conditional will show its contents if the delete action succeeds.
Examples
{exp:gallery_extended:delete delete_from_server="yes"}
{if success}Woopie!<br />{/if}
{message}
{/exp:gallery_extended:delete}
This example code would sit in a template. A user would click on a link that would take them to the template. The link would have the gallery entry id in the URL. Normally, this id would be obtained inside an exp:gallery_extended:entries tag by calling the {gallery_entry_id} variable.