Same partial view but different content based on the page rendered
Hello guys!
So what I'm trying to do (and don't know if it works like this in Umbraco) is to have a certain partial view, with certain textboxes but let the content editor upload content that shows to a specific page only. E.g:
Home page
Partial View A
textbox a - This is the home Page
Styling Page
Partial View A
textbox a - This is the Styling Page
So, different pages, Same partial view, content based on page.
Basically I want to do something like Episerver does, where I have a block of code, but the content can be different each time. Kind of. Is there a way to do that in Umbraco? (FYI I don't know how to use Episerver, I just know what it does)
Same partial view but different content based on the page rendered
Hello guys!
So what I'm trying to do (and don't know if it works like this in Umbraco) is to have a certain partial view, with certain textboxes but let the content editor upload content that shows to a specific page only. E.g:
So, different pages, Same partial view, content based on page.
Basically I want to do something like Episerver does, where I have a block of code, but the content can be different each time. Kind of. Is there a way to do that in Umbraco? (FYI I don't know how to use Episerver, I just know what it does)
Thanks in advance.
Hi Harry
Use Html.Partial helper for rendering your partial view.
And Umbraco.AssignedContentItem for accessing for current page data like that:
Have a look at https://our.umbraco.org/documentation/reference/querying/umbracohelper/
Thanks,
Alex
is working on a reply...