Hi Guys,
I'm using Umbraco 4.9.1 trying to make a Related Links Razor Macro Recursive throughout the entire site.
With XSLT or Common nodes this was simple enough, but I can't get it to work on Razor, I'm using the default Related Links code and it works great on the homepage, but it doesn't show the Related links nowhere else on the site, just the homepage.
This works great on the homepage, but when I navigate throughout the site, even though these macros are on the master template and should be present everywhere, they appear empty. I tried solutions with AncestorOfSelf and a few other suggestions here, but no avail.
Thanks for the replies! I'm a complete newbie with Razor.
Your suggestion works if I remove the "If" that comes with the Related Links "Stock" Script.
As a reference for anyone else with this issue, adding the "_" did the trick as you guys advised.
Recursive Related Links with Razor
Hi Guys, I'm using Umbraco 4.9.1 trying to make a Related Links Razor Macro Recursive throughout the entire site.
With XSLT or Common nodes this was simple enough, but I can't get it to work on Razor, I'm using the default Related Links code and it works great on the homepage, but it doesn't show the Related links nowhere else on the site, just the homepage.
Here's my Razor Code:
This works great on the homepage, but when I navigate throughout the site, even though these macros are on the master template and should be present everywhere, they appear empty. I tried solutions with AncestorOfSelf and a few other suggestions here, but no avail.
Anyone has any ideas? Thanks!
Hi Fernando,
Try this:
The way that you can do a value recrusive, is by adding the underscore _ before the property. So Model._property. The documentation can be found here: http://our.umbraco.org/documentation/Reference/Querying/DynamicNode/Properties
Hope this helps,
/Dennis
Hi Fernando,
You can make use of
to get a recursive value in razor
//fuji
Ah @Dennis you already replied to this threat!!
Thanks for the replies! I'm a complete newbie with Razor.
Your suggestion works if I remove the "If" that comes with the Related Links "Stock" Script. As a reference for anyone else with this issue, adding the "_" did the trick as you guys advised.
Here is the working result:
Thanks!
is working on a reply...