Item #

Whenever you're dealing with a list item in your template, you're actually working with a Item object.

Attributes #

idID of the item.
elementIdID of the linked element.
elementSiteIdSite ID of the linked element.
elementDisplayDisplay name of the linked element. ie \craft\elements\Entry would be Entry.
elementThe linked element.
titleThe Title of the linked element.
listIdID of the list this item belongs to.
listThe list this item belongs to.
optionsAny additional options to store with an item.
optionsSignatureAn MD5 hash of the options, used for comparing items uniqueness.

Methods #

getAddUrl()Returns the URL to add an item to a list.
getRemoveUrl()Returns the URL to remove an item from a list.
getToggleUrl()Returns the URL to toggle an item in a list.
getInList()Whether this item is in the list (default list or otherwise).

Get started with Wishlist

Available for Craft 3. Get it from the plugin store.