You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, bit of a noob question here regarding filenames using .cshtml. I have a header section part which I've added to my homepage content type. The part's technical name is HeaderSectionLarge. I have a Content-Homepage.cshtml file and I'm pulling in the header section using @await DisplayAsync(Model.Content.HeaderSection). This works if I name the header section file Homepage-HeaderSectionLarge.cshtml, but that's specific to it's use on a Homepage type. If I call the file just HeaderSectionLarge.cshtml nothing renders, so it looks like the template is not being found. But I'd prefer to have a less specific version that can be used on any content type rather than just HomePage. The docs here https://docs.orchardcore.net/en/latest/docs/reference/modules/Templates/ suggest that the less specific version (HeaderSectionLarge.cshtml) should work. What am I doing wrong?
Also, I'm having trouble overriding the BagPart html. I can override this in the admin using the templates feature, and this works but if I delete these (to go back to the default html) then add a BagPart.cshtml file this does not work and it's ignored. I can also use a more targeted version here ie. LinksBlock-BagPart.cshtml and this works but the top level BagPart.cshtml is ignored.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, bit of a noob question here regarding filenames using .cshtml. I have a header section part which I've added to my homepage content type. The part's technical name is HeaderSectionLarge. I have a Content-Homepage.cshtml file and I'm pulling in the header section using @await DisplayAsync(Model.Content.HeaderSection). This works if I name the header section file Homepage-HeaderSectionLarge.cshtml, but that's specific to it's use on a Homepage type. If I call the file just HeaderSectionLarge.cshtml nothing renders, so it looks like the template is not being found. But I'd prefer to have a less specific version that can be used on any content type rather than just HomePage. The docs here https://docs.orchardcore.net/en/latest/docs/reference/modules/Templates/ suggest that the less specific version (HeaderSectionLarge.cshtml) should work. What am I doing wrong?
Also, I'm having trouble overriding the BagPart html. I can override this in the admin using the templates feature, and this works but if I delete these (to go back to the default html) then add a BagPart.cshtml file this does not work and it's ignored. I can also use a more targeted version here ie. LinksBlock-BagPart.cshtml and this works but the top level BagPart.cshtml is ignored.
Is there a setting somewhere that I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions