Center logo in the middle of site navigation partial view
Hi
I am building a website in Umbraco 8 and using Bootstrap 4, The design for the site has the main navigation across the top with the Business Logo in the middle (3 nav links to the left, 3 to the right of the logo)
I have the following HTML for the navigation which works fine if hard coded but I'm not sure how to code it in a partial view (eg, select the Home node and the first 2 descendants, then place the logo, then select the next 3 descendants - including and descendants of those main pages
An easy route would be to put 2 multi-node treepickers (one for the left and one for the right) on your home node for each side of the nav and render those.
Ahh, now that is an option worth looking into. Would it be easy enough to also automatically display any dependants of those nodes from the normal MNTP code?
Center logo in the middle of site navigation partial view
Hi
I am building a website in Umbraco 8 and using Bootstrap 4, The design for the site has the main navigation across the top with the Business Logo in the middle (3 nav links to the left, 3 to the right of the logo)
I have the following HTML for the navigation which works fine if hard coded but I'm not sure how to code it in a partial view (eg, select the Home node and the first 2 descendants, then place the logo, then select the next 3 descendants - including and descendants of those main pages
Any advice on how I can code this would be grateful, I have done navigation partials before just not sure how to split it with the logo in the middle?
Thanks
Ben
Hi Ben,
An easy route would be to put 2 multi-node treepickers (one for the left and one for the right) on your home node for each side of the nav and render those.
Hope this helps,
Amir
Ahh, now that is an option worth looking into. Would it be easy enough to also automatically display any dependants of those nodes from the normal MNTP code?
By dependents do you mean child nodes? If so you should be able to loop through them like with any other nav code, something like below.
Great thanks Amir, it took a bit of playing around but I got it working
It looked at first glance to be ok and it renders fine but when I click on a link i get the below error.
The code in the Partial view is as follows and then this is bought in on the MasterPage with @Html.Partial("leftHandNavigation") :
Any ideas what the error is referring to?
thanks
Ben
is working on a reply...