Say I have a content structure like:
About Us
Information
Contact Us
Blah
When a user clicks About Us, how can I make it display the Information page?
This would be required on multiple site sections so hardcoding links / redirects won’t work.
How can I make a page display the content from the first child, if exists?
I think it might be easier to answer if you describe what you are trying to do.
But if you are on the “About Us” page (ie. Sitecore.Context.Item is the “About Us” item).
You can check if the current item has children like this:
You can access the children in the following way:
This returns a ChildList object on which you could call GetArray() to get an Item[].
If you just blindly wanted the first item I guess you could call:
But try to write a bit about what you are trying to do (ie make a menu or something).