I have a page Item in Sitecore, and I know it is derived from a certain base template. I have that base template ID, but I want to get the instance of this base template that is part of my page. I want it as an item, so for example I can get the ID of the template internal of the page.
To be more clear:
- Page called A1 of template A
- Template A has as base template the template B
- B is part of page A1 as an instance called B1 (field values specific for the page A1)
How can I get B1 as stand alone Item/ID?
Any help is appreciated.
Thanks.
Not really sure what you mean? why would you want to get the instance of an inheriting template? the item would have all fields you've inherited available anyway via item.fields[templateBFieldId].Value
You could do something like check if the current item inherits from that template.. so something like: