Developer forum

Forum » Development » DwTopLogoAlt

Reply
About a year ago I made a PageTemplateExtender with the following code:

namespace TopLogoAltTextTemplateExtender
{
    public class TopLogoAltTextTemplateExtender : PageTemplateExtender
    {
        public override void RenderTemplate(Dynamicweb.Templatev2.Template template)
        {
            // Set TopLogoImageAlt and BottomLogoImageAlt
            string topLogoImageAlt = "Temabillede";
            string bottomLogoImageAlt = "Temabillede for siden";

            PageView.TemplatePage.SetTemplateValue("DwTopLogoAlt", topLogoImageAlt);
            PageView.TemplatePage.SetTemplateValue("DwBottomLogoAlt", bottomLogoImageAlt);


It worked fine. Since then, the website has been upgraded, and now it doesn't work anymore. The website has been upgraded to 19.1.0.4.

I'm trying to replace the value of the Toplogo-templatetag.

Any ideas?

Replies

 
Nicolai Høeg Pedersen
Reply
You are using the pageview object - that can be the issue.. It utilizes the old template object which is now proxied to templatev2.

Change these 2:
PageView.TemplatePage.SetTemplateValue("DwTopLogoAlt", topLogoImageAlt);
            PageView.TemplatePage.SetTemplateValue("DwBottomLogoAlt", bottomLogoImageAlt);

to:

template.SetTag("DwTopLogoAlt", topLogoImageAlt);
template.SetTag("DwBottomLogoAlt", bottomLogoImageAlt);
 

 

You must be logged in to post in the forum