Setting Parent Page Dynamically

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/27/2012 10:08:36 PM
Gravatar
Total Posts 148

Setting Parent Page Dynamically

Is there a way to set the Parent Page property dynamically?

I have several pages that can be accessed through different paths. Depending on the path the user takes, I want to have the correct menu item (the menu items just under the root) highlighted.

What I would like is to gain access to the instance of the pages under the root page.  BTW, is there a way to gain access to the instance of any page I create?

 

 

7/29/2012 12:45:35 PM
Gravatar
Total Posts 18439

Re: Setting Parent Page Dynamically

Ultimately the menu controls and the site map are hierarchal trees and any given node cannot be in more than one place and cannot have more than one parent node. You can create additional links in the menu to a given page (either using the full url or an alternate friendly url that maps to the same page id) but it can only have on real parent and the menu only really knows about that one so it can only highlight correctly with that one.

From code you can access the pageSettings object of the current page from CacheHelper.GetCurrentPage(), you can also access the pageSettings object by passing in the page id and site id to its constructor.

PageSettings myPage = new PageSettings(siteId, pageId);

But the menu is binding to the site map which is a cached tree like object (again a node can only have one parent), site map nodes correspond to page Setting objects but they are not the same thing, sitemap and sitemap nodes are mainly for menu binding, pageSettings is for manipulating and persisting properties of a page.

Best,

Joe

7/30/2012 9:40:52 AM
Gravatar
Total Posts 148

Re: Setting Parent Page Dynamically

How do I get the pageId (or Guid) of the page? (If I'm not on that page)

Is there a way to retrieve this by Page Name? Url?

You must sign in to post in the forums. This thread is closed to new posts.