Developer forum

Forum » Development » TemplateExtenders and Configurable Add-Ins

TemplateExtenders and Configurable Add-Ins

Gaëtan Di Caro
Reply

Hello,

 

I'm stuggling with finding documentation on how to work exactly with configurable add-ins. Is it possible to add add-in parameters to a ProductTemplateExtender ? If so, where are they set in the backend ?

Here's an example code of what I'd like to do :

[AddInName("MyProductTemplateExtender")]
[AddInIsEditable(true)]
[AddInActive(true)]
public class MyProductTemplateExtender : ProductTemplateExtender
{
    [AddInParameter("MyParameter")]
    [AddInLabel("My Parameter")]
    [AddInParameterEditor(typeof(TextParameterEditor), "")]
    public string MyParameter{get;set;}
    
    public override void ExtendTemplate(Template template)
    {
        template.SetTag("MyTag", MyParameter);
    }
}

 

Thanks


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Nope, you can only add those to things that show up in the UI (that inherit ConfigurableAddin if I am not mistaken).

A ProductTemplateExtender has no UI and is therefore not configurable. You'll need to pull config from other places such as the global settings file.

Imar

Votes for this answer: 2
 
Gaëtan Di Caro
Reply

Ok thanks.

It would be quite interesting to be able to do this directly in Settings>Developer>AddIns>TemplateExtenders (or maybe on a website-level).

 

Is it possible to move this thread to "Feature Request" ?

 

You must be logged in to post in the forum