I have a master template that contains a navbar and a footer and it renders the navbar and footer content from a "home page" document type.
I also have a home page template that is a child of the master template and the home page looks clean and everything gets rendered...
I have then gone on and created a second page(doctype with a template)
That template also inherits from the master...
this is where the problem comes in, when I want to view that second page I get a compilation error because it's a child of the master, the master template tries to render content that is sitting in the home page doctype...
how can I resolve this issue?
How can I make my master template content dynamic? and still, have child templates under the master template?
I hope this makes sense, it's a really big problem for me that I NEED to solve urgently...
How to create Dynamic Master Template Content?
Hello everyone!
I have a master template that contains a navbar and a footer and it renders the navbar and footer content from a "home page" document type.
I also have a home page template that is a child of the master template and the home page looks clean and everything gets rendered...
I have then gone on and created a second page(doctype with a template) That template also inherits from the master...
this is where the problem comes in, when I want to view that second page I get a compilation error because it's a child of the master, the master template tries to render content that is sitting in the home page doctype...
how can I resolve this issue?
How can I make my master template content dynamic? and still, have child templates under the master template?
I hope this makes sense, it's a really big problem for me that I NEED to solve urgently...
Thank you
At this moment in the master i'm using this to render:
is there some way I can access the homepage content without saying "model"?
something along this line:
?
okay ,
Generally speaking , anything is related to home page should be in the home page template or at least but it in a partial view.
but In your case if u need to render things and some times not
you should make an if statement to wrap up any thing should make an error appear like the following :
this way it will only be render when it has a value ....
hope that helped
is working on a reply...