Developer forum

Forum » Development » Loop under PageTemplateExtender

Loop under PageTemplateExtender


Reply
I made a custom loop and some custom tags under PageTemplateExtender's method:
public
override void RenderTemplate(Dynamicweb.Templatev2.Template Template)

But only the custom tags work, the loop doesn't work.
I have tried add the same loop under ProductListTemplateExtender's method ' ExtendTemplate', it works there.

So, I wonder is there any limitation when people add a loop under PageTemplateExtender? Or just because I made something wrong?

Replies

 
Reply
Hi Judy,

Can you post the code for the extender and the template you're using?

Imar
 
Reply

Yes.

 
Reply

The picture is about the code which under the PageTemplateExtender.





est.jpg
 
Reply
Pfff, this forum creates such as mess from posted code ;-(

Can you either reformat the code or attach the relevant files? Quite difficult to see what's going on otherwise.

Also, did you post the code for the template?

Imar
 
Reply
ESTuser.jpg: the paragraph has chosen modul 'Extranet/Intrannet(Udvidet)'.

est2.jpg: template code.
est2.jpg ESTuser.jpg
 
Reply
This should work fine when you place the loop in the page template.

However, it seems you're extending an Extranet paragraph in which this won't work. You may be able to use a NotificationSubscriber for Paragraph.OnBeforeRender: http://engage.dynamicweb-cms.com/api/extensibility/Dynamicweb~Dynamicweb.Notifications.Standard+Paragraph~OnBeforeRender.html

Not sure if that's enough for your situation though.

Maybe someone else has better ideas.... ;-)

Imar
 
Reply

Thank you very much!

I decide to make a new custom module.

 

You must be logged in to post in the forum