I need to test for a doctype of "GroupingFolder" when traversing the nodes in my navigation, but I can't seem to get the syntax correct. Could someone take a look to see what I am missing?
It won't save the code as is. Says "The helper block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. "
Ok - Not sure what it could be then - Just wondering if you're using Visual Studio for writing the code? Or are you doing it in another editor? Just wondering if you have intellisense - If not it might help.
Otherwise I usually use an approach where I uncomment all the code and then make sure I don't see an error message. Then I start commenting in parts of the code and usually it's pretty quick to figure out where the problem is when progressing like this and have it fixed. Don't know if it's an approach that can work for you too?
I've got it in Visual Studio and It keeps saying the same thing as the Umbraco editor " } expected line 41", which is the last line, but adding a second closing bracket doesn't fix the error.
If I try to comment out lines as you suggest using @* in the Umbraco code editor I always get this error: Keyword, identifier, or string expected after verbatim specifier: @
Okay, I couldn't get the if syntax to work, so I used a terinary, but I wonder if there might be something wrong with my syntax even though it works, because It is showing my opening and closing { } in red. Can someone take a look to see if I am missing something? Thanks!
Nested " if " In Navigation
I need to test for a doctype of "GroupingFolder" when traversing the nodes in my navigation, but I can't seem to get the syntax correct. Could someone take a look to see what I am missing?
Hi Steve
What does the error message say? Does it provide a hint about where in the code things seem to go wrong?
/Jan
It won't save the code as is. Says "The helper block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup. "
Hi Steve
Ok, seems there is one too many } signs in the if/else block you have.
Try copy/pasting this and see if it works
Does this help?
/Jan
No, now it states that it is expecting a "}" at the last line.
Hi Steve
Ok - Not sure what it could be then - Just wondering if you're using Visual Studio for writing the code? Or are you doing it in another editor? Just wondering if you have intellisense - If not it might help.
Otherwise I usually use an approach where I uncomment all the code and then make sure I don't see an error message. Then I start commenting in parts of the code and usually it's pretty quick to figure out where the problem is when progressing like this and have it fixed. Don't know if it's an approach that can work for you too?
/Jan
I've got Visual Studio for the web, but I don't think there is a way to check Razor syntax.
I've got it in Visual Studio and It keeps saying the same thing as the Umbraco editor " } expected line 41", which is the last line, but adding a second closing bracket doesn't fix the error.
If I try to comment out lines as you suggest using @* in the Umbraco code editor I always get this error: Keyword, identifier, or string expected after verbatim specifier: @
Okay, I couldn't get the if syntax to work, so I used a terinary, but I wonder if there might be something wrong with my syntax even though it works, because It is showing my opening and closing { } in red. Can someone take a look to see if I am missing something? Thanks!
is working on a reply...