var contentPicker = docFolder.getProperty("mcr").Value; if (docFolder.HasProperty("mcr") && docFolder.getProperty("mcr").Value != String.Empty) { int id= Convert.ToInt32(contentPicker); dynamic node = new DynamicNode(id); }
I'd move the contentPicker variable inside the if statement too (or get rid of it altogether if you're not using elsewhere), just in the interest of scoping:
if (docFolder.HasProperty("mcr") && docFolder.getProperty("mcr").Value != String.Empty)
{
int id= Convert.ToInt32(docFolder.getProperty("mcr").Value);
dynamic node = new DynamicNode(id);
}
Converting Content Picker Id to NiceUrl
Hi guys,
I just cant get this working and am pretty sure its something very simple.
I have a content Picker in my media section and when i try to convert the content id to int32 so as to get the url my razor file just crash.
Anyone mind having a look at this ?
did try this as well
//fuji
Hi Fuji,
Could you please post the error here so I can see what's going wrong?
Thanks
Ali
The file is saved without error but as soon as you render it on the front end it just cant load it
Error loading MacroEngine script
can you try this?
No not working here as well. Getting some ugly error when saving the file
The best overloaded method match for 'int.TryParse(string, out int)'
Nothing seems to be working here. Can anyone point out what am doing wrong here
Here is my whole code
I finally managed to get this working.
I'd move the contentPicker variable inside the if statement too (or get rid of it altogether if you're not using elsewhere), just in the interest of scoping:
is working on a reply...