Linking to Umbraco page based on it's document type
Hi,
I'm wondering how I would go about to create a link to a page, without knowing it's name forehand. But I would rather just look for the next page of a certain document type.
For example; I have a User profile page (and document type) which is baed upon user controls. Under that I have another (child) page called "edit profile" with it's own document type. How would I add a link to the "user profile" -page that would link to the "edit profile" -page, when I don't know it's published name.
The reason I'm doing this is that I want to mirror the site in multiple languages, so there would be other versions of these same pages. So instead of redoing the link for every page, I'd like to do this in code (or xslt, whichever is more convinient).
you don't need to know a document's name, you can get to that page based on the properties of a page. For example:
umbraco.presentation.nodeFactory.Node currentNode = umbraco.presentation.nodeFactory.GetCurrent();
var children = currentNode.Children;
foreach (umbraco.presentation.nodeFactory.Node childNode in children) {
var alias = childNode.ContentType.Alias;
}
Linking to Umbraco page based on it's document type
Hi,
I'm wondering how I would go about to create a link to a page, without knowing it's name forehand. But I would rather just look for the next page of a certain document type.
For example; I have a User profile page (and document type) which is baed upon user controls. Under that I have another (child) page called "edit profile" with it's own document type. How would I add a link to the "user profile" -page that would link to the "edit profile" -page, when I don't know it's published name.
The reason I'm doing this is that I want to mirror the site in multiple languages, so there would be other versions of these same pages. So instead of redoing the link for every page, I'd like to do this in code (or xslt, whichever is more convinient).
with thanks,
H.
you don't need to know a document's name, you can get to that page based on the properties of a page. For example:
Hope this helps.
Regards,
/Dirk
is working on a reply...