I'll try to put my problem as simply as possible below. Excuse me of etiquette mishaps and such as I'm totally new here and have been working with SharePoint only for a few months. Be sure to correct me though.
I'm building a custom navigation with SharePoint 2013. I'm at a point where I have a working Metadata Navigation in place. I need a way to go through the terms in the Site Navigation term set so that I can spit out a custom (html) menu structure to certain publishing page layouts.
I've also read that using code behind in page layouts (.aspx) isn't the best way to go as it might lead to security problems. I feel like I'm left with nothing.
At the moment this forums seems the only place I could find pro-level people who could guide me to the right direction. Every answer and every intention to help is greatly appreciated!
The problem more specifically and in a form of a question:
I need to display a three levels deep Metadata based navigation (with friendly urls) in a page layout. Each of the navigation levels must be shown in different places in the page with a different set of styles. How can I achieve this?
Below is a link to a picture to illustrate what I mean.