Hi
In a normal html template you get all module tags when using DwTemplateTags inside a loop. Is there any way to accomplish that when using a razor template? If not, is there another way to get the list og templatetags?
Regards Thomas
Hi
In a normal html template you get all module tags when using DwTemplateTags inside a loop. Is there any way to accomplish that when using a razor template? If not, is there another way to get the list og templatetags?
Regards Thomas
Thanks Morten.
It seems a bit more difficult to use. Are there any plans for a more 'designer friendly' approach?
Regards Thomas
Here is another example - but it probably isn't designer friendly either :)
I have made a few helper functions that can be included and used in other Razor templates. It renders some tables with the tag names and values.
You can use it like this...
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using System; @using System.Linq; @using Dynamicweb.Rendering; <!--@Include(Debug.cshtml)--> <div> <h1>Using helper functions to display available values</h1> <!-- Most tags can be rendered using the good old DwTemplateTags --> <!--@DwTemplateTags--> <!-- Render all basic values (normal template tags) --> @ShowValues() <!-- Render all values available in specific loops. You can specify a path to render values of a nested loop. --> @ShowLoopValues("Products","Products/AssociatedGroups") <!-- Render specific global values --> @ShowGlobalValues("Global:Page.ID", "Global:Page.Name") </div>
I have attached the files Debug.cshtml (where the helpers are defined) and ProductList.cshtml (the example above).
Note: The nested loops part requires DW 8.3.0.5 or later
Nice work, Morten.
We've been playing around with something similar using Razor helpers and functions, but it may also make sense to build some inspection/debugging functions into Dynamicweb Razor, i.e. in a dll. What do you prefer?
This should be combined with IntelliSense on which I see you've made some progress as well (cf. http://developer.dynamicweb-cms.com/forum/templates/make-visual-studio-recognize-dw-methodes.aspx) to give a cool and easy to work with environment.
Please, suggest any helpers and methods you like to see here or on the Dynamicweb Razor wiki page Razor like DwTemplateTags.
Best regards,
Mikkel
What about implementing a tab for Glimpse with the relevant data? A bit like what Pavel did with the script plugin: http://getglimpse.com/Help/Custom-Tabs
Imar
How about "all of the above"? :)
Glimpse support would be awesome. I've seen a few CMS providers tap into Glimpse already. But sometimes it's also nice to just add something like @DwTemplateTags and have it show all objects without scope.
Glimpse support is less intrusive on the page but more to setup initially, so both have their value in different situations.
Scott
We are already working on Glimpse integration and custom tabs implementation for the things you would normally get by using debug=true. Other possible custom tabs we might implement is eCommerce basket and maybe caching and logging. We also hope to hook into the Glimpse Timeline, but the Glimpse API's are still poor when it comes to anything else than custom tabs.
We plan to support Glimpse when we upgrade to the newest .NET framework.
Klavs Martens
Dynamicweb
You must be logged in to post in the forum