Adrian Garner
Adrian Garner

Reputation: 5345

Get the name of the content type from a page template

I have a view for a folderish content type. I would like to leave out some fields based on which content type they are in. Is there a way to get the content type an object is from?

Upvotes: 1

Views: 103

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1124858

All content types have a portal_type attribute (the type id as listed in the portal_types tool), as well as a Type attribute (the type title).

These are present even when listing content from the catalog.

Upvotes: 3

Related Questions