Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How do you find the template alias of the current page?
@Model.template will give you its ID and I thought I could then use Library.NodeById but I'm struggling to get anywhere with it.
Regards,
Matt
You should be able to use the API to get the template alias using the ID property:
@using umbraco.cms.businesslogic.template;
var templateAlias = new Template(Model.template).Text;
Thank you Barry,
I'll give that a try.
var templateAlias =new Template(Model.template).Alias;
was what I needed.
Thanks, Matt
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Finding the template alias of the current page.
How do you find the template alias of the current page?
@Model.template will give you its ID and I thought I could then use Library.NodeById but I'm struggling to get anywhere with it.
Regards,
Matt
You should be able to use the API to get the template alias using the ID property:
var templateAlias = new Template(Model.template).Text;
Thank you Barry,
I'll give that a try.
was what I needed.
Thanks, Matt
is working on a reply...