Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# bolo 11/15/2006 11:00 AM
Hi,

We have a small module (SiteMapPath) to display the path of the page the user are in. In the module we build the sitemappath string iterating on nodes in this.Section.Node.NodePath ( foreach (Node n in this.Section.Node.NodePath) ):

If the module is linked to a node it works fine but if linked to a template this.Section.Node is null (that is expected because the module is not linked to a node as i said before).

Is there any way for a module linked to a template to know about the node where it is running in?

Thanks,

César.
# mpw 12/16/2006 12:06 PM (edited 12/16/2006 12:07 PM)
Cesar,

I needed to do the same thing but I did it by creating a template control rather than a module; because I wanted the breadcrumb on each page. Code attached if that helps.

Cheers,
Mark
# Nicole 12/18/2006 11:15 AM
I created a bread crumb style navigation module that is linked at the template level. To access the current node I did the following:
this._page = (PageEngine)this.Page;

Node n = this._page.ActiveNode;
Node[] npath = n.NodePath;

Once I had the note path array I did a foreach to loop through the nodes.