Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SiteMapTitle help #209

Closed
gregorypilar opened this issue Aug 20, 2013 · 3 comments
Closed

SiteMapTitle help #209

gregorypilar opened this issue Aug 20, 2013 · 3 comments

Comments

@gregorypilar
Copy link

Hi,
I'm implementing SiteMapTitle Attribute, but something strange , the name dependents on a db query and its work fine but in the following structure :

1-Node
2-Node (Here the nodes are generated base on DynamicNodeProviderBase)
Two nodes with different values
3-Node (here it's where I've the SiteMapTitle Attribute the name come from the db ) in Breadcrumbs node 4... to N all childrens of Node 3 the name is displayed like I expected, but if I go back to node 2 and go to other generate node the name in nodes 4 to N not display the name of the node its displays the name of the first node I selected before. And I dont Know why , or what y have to do

@NightOwl888
Copy link
Collaborator

The sitemap title attribute is only capable of setting the title for the current node or the parent node of the current node from a specific action method. However, you can also change the title by setting it directly in your controller action:

MvcSiteMapProvider.SiteMaps.Current.CurrentNode.ParentNode.ParentNode.Title = "My Title";

Both of the above methods only overwrite the title for the current request - once the request is finished, the values are discarded.

In general, you don't usually need to set the title with dynamic node provider, because you can set the title attribute directly in your dynamic node provider. When you set the title this way, it is stored in the persistent cache and will be used across multiple requests.

@NightOwl888
Copy link
Collaborator

Ok, I have fixed a bug described in #212 that might be related to this (or might be the same thing). The fix is in v4.0.17, which is now up on NuGet.

@gregorypilar
Copy link
Author

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants