Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6610621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:51:51+00:00 2026-05-25T19:51:51+00:00

In the starter kit using xpath builder, how do I get all the items

  • 0

In the starter kit using xpath builder, how do I get all the items that inherit from the ‘Site Section’ template under the Home item?

When I run the following:

/sitecore/content/home/*[@@templatekey='product section'] 

one item is returned /sitecore/content/Home/Products which makes sense, however, the following does not return anything:

/sitecore/content/home/*[@@templatekey='site section'] 

What I’m trying to do is build a menu from the items that inherit the ‘Site Section’ template using asp.net web control instead of xslt.

Any ideas?

Thanks,
Tarek

** UPDATE

Provide more info on the question:

Item /sitecore/content/Home/Products has template /sitecore/templates/Starter Kit/Site Sections/Product Section which has a base template of /sitecore/templates/Starter Kit/Item Types/Site Section

If I want the Products and References (similar to Products) items under Home I would run the following query:

/sitecore/content/home/*[@@templatekey='product section' or @@templatekey='references section']

Is there a way to get the item under Home that has Site Section as the base template. In xslt there is a method sc:GetItemsOfType('site section',$home/item) which does it.

** Answer

var homeItem = Sitecore.Context.Database.GetItem(Sitecore.Context.Site.StartPath);
var siteSectionItems = new List<Item>();

foreach (Item item in homeItem.Children)
{
    var itemTemplate = TemplateManager.GetTemplate(item);

    if (itemTemplate.InheritsFrom("Site Section"))
        siteSectionItems.Add(item);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:51:51+00:00Added an answer on May 25, 2026 at 7:51 pm
    var homeItem = Sitecore.Context.Database.GetItem(Sitecore.Context.Site.StartPath);
    var siteSectionItems = new List<Item>();
    
    foreach (Item item in homeItem.Children)
    {
        var itemTemplate = TemplateManager.GetTemplate(item);
    
        if (itemTemplate.InheritsFrom("Site Section"))
            siteSectionItems.Add(item);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if there was somewhere I could get some starter kit /
I would like to start using the WCF Rest Starter Kit's HttpClient to build
I've written some code using the REST starter kit and it works fine on
I'm using the new HttpClient class, part of the WCF REST Starter Kit, to
Is that better to use WCF REST Starter Kit for consuming web services (REST)
I recently had a problem with the Issue Tracker starter kit that seemed to
I am using the extremely awesome HttpClient provided in the WCF REST Starter Kit.
I just started with the WCF REST Starter Kit. I created a simple service
Is it possible to use protobuf-net in RESTful webservices created using WCF RESTful starter
I'm new to REST and I'm building a service using the WCF REST Starter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.