0

my requirements:

  • A way to list all Structure Groups within current level (or by parent)
  • A way to list all child Pages within current Structure Group
  • A way to get all meta tags (filterCategory) from all child Pages within products Structure Group

Basically I am building a Page filter, which purpose is to filter products on a product/news list Page.

It has a topmenu for navigation between different lists + meta tags that exist within each Page, to show/hide products on the list Page with JavaScript.

- Products (Structure Group)
-- Product Page (Page with Components)
-- Product list 1 (Structure Group)
-- Product list 2 (Structure Group)
-- Product list 3 (Structure Group)

Using Tridion 2013

Tips and tricks much appreciated.

I was thinking of using the Content Delivery (JSP) to do this. Is this the best way?

  • 3
    Please edit your question and provide some more details. Do you want to do this with TOM.NET (for publishing), with a Core Service script, or in the Content Delivery side? – Harald Hoffelinck Jun 15 '17 at 11:29
  • I was thinking of combining razor and jsp code. I am fearly new to Tridion and the concepts of working with this CMS. So I might be looking for that answer myself. – c0d3x Jun 15 '17 at 11:53
  • 1
    We tend to have a template that pushes this hierarchical information and any additional metadata to the delivery side (like in JSON or XML) and then use that as input for your "widget" – Nuno Linhares Jun 15 '17 at 12:36
  • How do I do that then? – c0d3x Jun 19 '17 at 9:59
2
[TcmTemplateTitle("XML")]
public class XMLTemplate : TemplateBase
{
    public override void Transform(Engine engine, Package package)
    {
        base.Transform(engine, package);


        OrganizationalItemItemsFilter filter = new OrganizationalItemItemsFilter(engine.GetSession());
        filter.ItemTypes = new ItemType[] { ItemType.StructureGroup, ItemType.Page };
        filter.Recursive = true;
        filter.BaseColumns = ListBaseColumns.Extended;            

        // Retrieve only items from the root structure group
        XmlElement list = Publication.RootStructureGroup.GetListItems(filter);

    //TODO: Loop through all the list and build the pages and URLs as XML Refer TOM.NET for SDL APIs Page, Component, and metadata objects

        package.AddXml(Package.OutputName, xxxxx.OuterXml);
    }
}

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.