6

I using next code to check that item is component:

$models.getItemType(itemId) == $const.ItemType.COMPONENT

It work fine for me, but I need to check that given component is multimedia component, the $models.getItemType(itemId) returns "tcm:16" for component and multimedia component as well. Is there any other way to check this?

8

You can check if an item is a multimedia component with this code

  $models.getItem(itemId).isMultimedia()

this will return true or false.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.