Developer forum

Forum » Development » How to include links in a list view

How to include links in a list view


Reply

I have a case, where I need to show a list of products in a Product Catalog paragraph that contains two types of products. The difference is that they require two different templates to be shown correctly.


 


I have two types of events, that need to be shown in the same Events list template (listing all events). In this list template they should look the same (display same type of data) but when you click to see the detailed information about the event, they should use different templates.


 


In eCom I can only define one detail template for a paragraph of the type Product Catalogue. Right now Im thinking that I need to add a custom field on the products (even, and then by javascript in the template - show and hide the things that are different in the two detail template cases.


 


But is there a simpler way to do this?


Replies

 
Nicolai Høeg Pedersen
Reply
src@forbrugerliv.dk wrote:


I have a case, where I need to show a list of products in a Product Catalog paragraph that contains two types of products. The difference is that they require two different templates to be shown correctly.




 




I have two types of events, that need to be shown in the same Events list template (listing all events). In this list template they should look the same (display same type of data) but when you click to see the detailed information about the event, they should use different templates.




 




In eCom I can only define one detail template for a paragraph of the type Product Catalogue. Right now Im thinking that I need to add a custom field on the products (even, and then by javascript in the template - show and hide the things that are different in the two detail template cases.




 




But is there a simpler way to do this?





Create a ProductTemplateExtender (http://documentation.dynamicweb.dk/Admin/Public/Download.aspx?File=Files%2fFiler%2fDocumentatoion+portal%2fDynamicweb+CMS%2fDocumentation%2fDevelopment%2f7850_(en-US)_Extensibility_API__Dynamicweb_eCommerce.pdf on page 18)


 


The extender has a method called ExtendTemplate which has a template object as parameter. This is the template containing the html of the specified template. You can alter the HTML of t.he object usinge Template.HTML. You can get information on which template to use by adding a field on the product which is a filemanager. On the product choose a template for the product, and read it in the extender and assign the HTML of the file to the HTML property of the template object....


 


I can not guarantee it will work - but give it a try. 

 
Reply
NP wrote:

src@forbrugerliv.dk wrote:





I have a case, where I need to show a list of products in a Product Catalog paragraph that contains two types of products. The difference is that they require two different templates to be shown correctly.


I have two types of events, that need to be shown in the same Events list template (listing all events). In this list template they should look the same (display same type of data) but when you click to see the detailed information about the event, they should use different templates.


In eCom I can only define one detail template for a paragraph of the type Product Catalogue. Right now Im thinking that I need to add a custom field on the products (even, and then by javascript in the template - show and hide the things that are different in the two detail template cases.


But is there a simpler way to do this?









Create a ProductTemplateExtender (http://documentation.dynamicweb.dk/Admin/Public/Download.aspx?File=Files%2fFiler%2fDocumentatoion+portal%2fDynamicweb+CMS%2fDocumentation%2fDevelopment%2f7850_(en-US)_Extensibility_API__Dynamicweb_eCommerce.pdf on page 18) 




The extender has a method called ExtendTemplate which has a template object as parameter. This is the template containing the html of the specified template. You can alter the HTML of t.he object usinge Template.HTML. You can get information on which template to use by adding a field on the product which is a filemanager. On the product choose a template for the product, and read it in the extender and assign the HTML of the file to the HTML property of the template object....




I can not guarantee it will work - but give it a try. 



Thanks, it sounds like this will do the job!


 


The link you posted does not work, but I found the pdf here - http://documentation.dynamicweb.dk/Articles-23329.aspx?NewsID=1274

 

You must be logged in to post in the forum