Item#

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

Attributes#

AttributeDescription
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#

MethodDescription
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).

Previous ← List Next Events →