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

Dynamic ID in URL #79

Closed
whyteboi opened this issue Sep 13, 2012 · 3 comments
Closed

Dynamic ID in URL #79

whyteboi opened this issue Sep 13, 2012 · 3 comments

Comments

@whyteboi
Copy link

Hey,

I've been struggling with this for a while thought I might find an answer quicker this way.

I would like to display the ID of the record being edited in place of the "Details" node.

For Example:

URL: Receipt/Edit/120432 would render Home > Receipts > 120432 > Edit
(Where clicking on 120432 would return you to the details page for edit)

I can get this working almost perfectly - with the exception of displaying the ID.

Here's the configuration:

I can set the title dynamically using a [SiteMapTitle("id")] but it only reflects the current node. Not the previous "details" node.

@chaoaretasty
Copy link
Contributor

The way I did this (which only works if there is only one variable) is to use "Edit {0}" as the title, then run the breadcrumbs/menu through string.Format, passing in the variable to override.

@NightOwl888
Copy link
Collaborator

This looks like the same issue described here. Follow the link and you may be able to create a custom title provider to resolve this issue.

@NightOwl888
Copy link
Collaborator

I didn't realize this before, but there is also a way to edit the parent node using the SiteMapTitle attiribute. You need to set the Target property to ParentNode.

[SiteMapTitle("id", Target = AttributeTarget.ParentNode)]

It is also now possible to add multiple attributes to the same method, so you can set both the titles of both the parent and current node at the same time if you like.

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

3 participants