Hi. I'm new to Umbraco, building my first site. I have created a macro using LeBlender and that works fine. But now I want to try and add some code that references the CurrentPage. I can see that the LeBlender Model doesn't support this, so do I need to add another @imports or @using declaration at the top of my partial? Many thanks!
This way, you can access the Umbraco context and helper and the current content through the method:
Umbraco.AssignedContentItem
But this method works only in frontend. If you need a preview of your view within the backend, use the method we added into LeBlender helper which works in both backend and frontend:
Hi Antione. Thanks very much - I've got it working now. Is there somewhere I can download details of all the LeBlender properties and methods? The PDF that came with the install seems pretty short and there's not much to find via a standard web search. Many thanks again for helping me!
IsFrontEnd() // return true if the current context is frontend
Thanks for that Antoine! It's just helped me sort out an issue in the backoffice whereby adding certain css to a div I'm adding via LeBlender made the LeBlender un-editable, i.e. you could add it then set the CSS, but then not re-edit it.
How do I see the CurrentPage value?
Hi. I'm new to Umbraco, building my first site. I have created a macro using LeBlender and that works fine. But now I want to try and add some code that references the CurrentPage. I can see that the LeBlender Model doesn't support this, so do I need to add another @imports or @using declaration at the top of my partial? Many thanks!
Hi Mike,
The view have to inherit from UmbracoViewPage
This way, you can access the Umbraco context and helper and the current content through the method:
But this method works only in frontend. If you need a preview of your view within the backend, use the method we added into LeBlender helper which works in both backend and frontend:
Hi Antione. Thanks very much - I've got it working now. Is there somewhere I can download details of all the LeBlender properties and methods? The PDF that came with the install seems pretty short and there's not much to find via a standard web search. Many thanks again for helping me!
Hi Mike, the doc is short but really there isn't much more to know :)
I just have to add some lines about the helper I mencioned before, but actually it has only two methods:
and
IsFrontEnd() // return true if the current context is frontend
Hi Antione. That's great - thanks for explaining it all to me! I'm finding LeBlender really useful. Thanks for all the hard work! :o)
This Lecoati.LeBlender.Extension.Helper.GetCurrentContent()
Does not work if the node is unpublished, then what to do ?
Thanks for that Antoine! It's just helped me sort out an issue in the backoffice whereby adding certain css to a div I'm adding via LeBlender made the LeBlender un-editable, i.e. you could add it then set the CSS, but then not re-edit it.
Gracias!
is working on a reply...