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
Hi,
I'm using an altTemplate for pages that are accessed through this link:
<a href="/research/researchcategory?category=social%20marketing">social marketing</a>
where 'researchcategory' is my altTemplate
The problem I have currently that I can't seem to access any node that is from the Razor script that is implemented on this altTemplate:
var researchprojects = Model.Children.Where("NodeTypeAlias == \"ResearchProject\" && researchCategory == \"" + researchcategory + "\"");
Is it not possible to access nodes from a Razor script on an altTemplate, or I am I just doing something wrong?
Thanks for your help,
Anthony
found the solution, this Razor script works:
var researchprojects = Model.AncestorOrSelf().Descendants().Where("NodeTypeAlias == \"ResearchProject\" && researchCategory == \"" + researchcategory + "\"");
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
cannot access node from Razor script on altTemplate
Hi,
I'm using an altTemplate for pages that are accessed through this link:
<a href="/research/researchcategory?category=social%20marketing">social marketing</a>
where 'researchcategory' is my altTemplate
The problem I have currently that I can't seem to access any node that is from the Razor script that is implemented on this altTemplate:
var researchprojects = Model.Children.Where("NodeTypeAlias == \"ResearchProject\" && researchCategory == \"" + researchcategory + "\"");
Is it not possible to access nodes from a Razor script on an altTemplate, or I am I just doing something wrong?
Thanks for your help,
Anthony
found the solution, this Razor script works:
var researchprojects = Model.AncestorOrSelf().Descendants().Where("NodeTypeAlias == \"ResearchProject\" && researchCategory == \"" + researchcategory + "\"");
is working on a reply...