Developer forum

Forum » Development » Template.GetLoop("CustomLoop") html?

Template.GetLoop("CustomLoop") html?

Remi Muller
Reply
 var myloop = Template.GetLoop("CustomLoop");
if i try to read myloop.Html it is empty
myloop Html is only availble after calling CommitLoop. This is too late for my current scenario.

I want to access the raw template html. I need to know if something is in the template. It is not a dw tag.

Please tell my how to access the loop template html without calling CommitLoop?

Replies

 
Morten Snedker
Reply
 Hi Remi,

I don't quite get it...why don't you just open the file and look for what-ever you're looking for?

Or perhaps you could try to explain more explicitly what it is you try to accomplish?


Regards

Morten Snedker

 
Remi Muller
Reply
It is used in a ProductListTemplateExtender
ExtendTemplate(Dynamicweb.Templatev2.Template Template)
{
var myloop = Template.GetLoop("CustomLoop");

myloop.Html is empty
I wanted to search the myloop.html.

I could look into Template.html. This contains the full (productlist) template. Right?
Is it valid to search the Template.html property to determine if some custom html element is in the template?
It is not always the same productlist html template. The filename is not in the Template object?

 
Vladimir
Reply
This post has been marked as an answer
 Hi Remi!
Look at function Dynamicweb.Modules.Common.CommonMethods.GetLoopAsTemplate

I hope it is what you seek. Although this not works with xslt templates

Best regards,
Vladimir
Votes for this answer: 0
 
Remi Muller
Reply
 Thanks that would work html templates.
In case of an xslt would the Template.Html contain the xslt markup?

I have another pending question:

http://developer.dynamicweb-cms.com/forum/development/filemanager-editable-extensions.aspx

Do you have an answer?

 
Vladimir
Reply
Hi Remi,
yes, it will contain xslt markup

another question I gave answer in corresponding thread

Best regards,
Vladimir

 
Remi Muller
Reply
 Thanks!

 

You must be logged in to post in the forum