Developer forum

Forum » Feature requests » Breadcrumb improvements, extend page API?

Breadcrumb improvements, extend page API?

Dmitrij Jazel
Reply

Hello guys, I actually got arround a suggestion here,

Please feel free to relocate this thread, or send suggestions, or correct me if I am missing the point here..

As far as I remember I am creating breadcrumbs exactly the same way I used to do in DW 19.2.9.5...

I remember some tima go, there was a "legend" DW tag that is gone now (atleast I can't find it).

 

And since we are using Razor, and Items, maybe we could leverage that somehow to improve/extend what XSLT and dwnavigation.

For example, make something like this:

var page = getCurrentPage(); // this (or simmilar) method ofcourse exists

List<Dynamicweb.Content.Page> subpages = page.getChildren(); // something like this (as far as I know) does not exist yet in DW, does it?

other C# magic with page API etc...

 

This could also be used for rendering DW navigation eventually also for rendering any navigation, same as XSLT does today.

 

Nearly every single project requires one or another change to dwnavigation XSLT. And when you need to "mix it with Razor" in one or another way.

 

It's just a suggestion, and if something like this was already done in DW, than maybe I could get some examples that could help me render Navigation (breadcrumbs more specifically) in Razor in someway?

 

Much appreciated! :-)

Dmitrij


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Dmitrij

It would be really nice with a razor based navigation. The navigation system in Dynamicweb just has a lot of things built in with permissions, rules, providers etc etc. All of this runs in XML and is therefore not available in Razor - it requires quite a bit of refactoring. But it will come.

So you are stuck with XSLT navigations for now - it should not be that difficult.

You can get the current page in Razor by using Pageview.Page - that page will have a named property, Page.get_Value("pagechilds") that contains an ArrayList of child items.

Nicolai

 
Dmitrij Jazel
Reply

Hei Nocilai, 

I just just remembered that This particular thing "Razor based Navigation", it was demonstrated during DWTC2015.

Was wondering if you could share the link where exactly it is located on Github? I can't seem to find it :-/

Mikkel demonstrated Razor based Navigation example during one of this sessions I think

 

/Dmitrij.

 
Morten Bengtson
Reply
This post has been marked as an answer

https://github.com/dynamicweb/dwtc15/blob/master/mri/Files/Templates/Designs/Dwtc15/Partials/_Navigation.cshtml

Votes for this answer: 1
 
Morten Bengtson
Reply
 
Dmitrij Jazel
Reply

Ahh Thank you so much Morten! :)