Metadata – Tridion 2009 – Parent Folder TCM of Retrieval Components

Quick question. I’m building a template building block (TBB) that retrieves the metadata schema value from the component’s parent folder. For example, all components listed in this folder Will share the same title, but with different content. So, I created a pattern and attached it to the parent folder. This way, if I want to change the title of all components, all I have to do is change the meta on the folder Data value.

I have this parent folder that is hardcoded using TCM, but I need to grab it dynamically. Does anyone know how to grab the TCM of the parent folder?

Thank you for your help.

RepositoryLocalObjects all have a “.OrganizationalItem” Attribute, it will return the container of the object.

Things along these directions should get you started:

Component component = (Component )engine.GetObject(package.GetByName(Package.ComponentName));
Folder parent = (Folder)component.OrganizationalItem;
ItemFields folderFields = new ItemFields(parent.Metadata, parent.MetadataSchema);

Quick question. I’m building a template building block (TBB) that retrieves metadata schema values ​​from the component’s parent folder. For example, the ones listed in this folder All components will share the same title, but have different content. Therefore, I created a pattern and attached it to the parent folder. This way, if I want to change the title of all components, all I have to do is change the folder

I have this parent folder that is hardcoded using TCM, but I need to grab it dynamically. Does anyone know how to grab the TCM of the parent folder?

Thank you for your help.

RepositoryLocalObjects have a ".OrganizationalItem" attribute, which will return the container of the object.

Things along these directions should get you started:

Component component = (Component)engine.GetObject(package.GetByName(Package.ComponentName ));
Folder parent = (Folder)component.OrganizationalItem;
ItemFields folderFields = new ItemFields(parent.Metadata, parent.MetadataSchema);

Leave a Comment

Your email address will not be published.