Favorites Documentation

Favorites:Delete_All template tag

The Favorites:Delete_All tag allows your members to delete all of their favorites at once. Be very careful with this, as any member that loads this page will have ALL of their favorites removed instantly, and there is no way to recover that data.

{exp:favorites:delete_all}

Setup

The Favorites:Delete_All tag will simply output a confirm or error message. Below is a very simple example of how your Delete All template might look like:

{exp:favorites:delete_all type="entry"}

Parameters

The following parameters are available for use:

collection=

collection="articles"

This parameter allows you to delete all favorites filtered by the collection name.

type=

type="entry"

This parameter sets which kind of favorites to delete. There are 2 options for the type parameter:

  • entry (default) - channel entries
  • member - member accounts

You would then link to that template from another template to give users the option to delete all of their favorites. It’s strongly recommended you provide an extra confirmation such as the below example:

<script type="text/javascript">
    function ConfirmDelete()
    {
        var answer = confirm(
            "Warning: Are you sure you want to delete all your" +
            " Favorites? This action cannot be undone!"
        );

    if (answer)
        window.location.href = "{path='path_to/delete_all_template'}";
    }
</script>

<form>
    <input
        type="button"
        value="Delete All Favorites"
        name="delete_all"
        onclick="ConfirmDelete()"
    />
</form>

Support

Having problems setting up and/or using Favorites? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.