valdisiljuconoks / optimizely-advanced-contentarea

Optimizely content area renderer on steroids
Apache License 2.0
34 stars 14 forks source link

No additional HTML rendered after package install #87

Closed brb72 closed 3 years ago

brb72 commented 3 years ago

Hey, we just installed this package and selected half-width on a standard HTML content block.

After saving the block and viewing the page again, we aren't seeing any change in the HTML. I was expecting to see a new

element with the bootstrap classes wrapping the aforementioned content block.

Is there any other setup or configuration we're missing?

epibootstrap opts

valdisiljuconoks commented 3 years ago

It's should definitely render appropriate classes ;) that's the main purpose of this package.

Can you check if your ContentAreaRenderer is not overwritten to some other type for some reason?

brb72 commented 3 years ago

I did a CTRL + SHIFT + F in our solution and didn't see any files containing "ContentAreaRenderer" - so I'd guess we're using whatever the Epi default is there?

We're running CMS version 11.18: image

valdisiljuconoks commented 3 years ago

Hi,

Just re-tested again with plain AlloyTech sample site. Additional HTML element with CSS classes is rendered properly. Used following versions:

  <package id="EPiBootstrapArea" version="5.3.3" targetFramework="net48" />
  <package id="EPiServer.CMS" version="11.20.5" targetFramework="net48" />
  <package id="EPiServer.CMS.AspNet" version="11.20.5" targetFramework="net48" />
  <package id="EPiServer.CMS.Core" version="11.20.5" targetFramework="net48" />
  <package id="EPiServer.CMS.TinyMce" version="2.10.1" targetFramework="net48" />
  <package id="EPiServer.CMS.UI" version="11.34.1" targetFramework="net48" />
  <package id="EPiServer.CMS.UI.AspNetIdentity" version="11.34.1" targetFramework="net48" />
  <package id="EPiServer.CMS.UI.Core" version="11.34.1" targetFramework="net48" />
  <package id="EPiServer.Framework" version="11.20.5" targetFramework="net48" />
  <package id="EPiServer.Framework.AspNet" version="11.20.5" targetFramework="net48" />
  <package id="EPiServer.Logging.Log4Net" version="2.2.2" targetFramework="net48" />
  <package id="EPiServer.ServiceLocation.StructureMap" version="2.0.3" targetFramework="net48" />

It might be also so that ContentAreaRender is overwritten by some 3rd party assembly - meaning that it's inside some other .dll file. Searching for ContentAreaRender inside your code base might yield no results.

One of the ways to check this for sure - is to install Episerver DeveloperTools and check what do you have inside dependency container.

brb72 commented 3 years ago

Hey, thanks for the fast replies and further testing. I just added the EPi Dev Tools package and got that running. Here's what I'm seeing when doing a search on that page for "ContentAreaRenderer" (under the "Container" tab):

EPiServer.ServiceLocation.ServiceAccessor`1[[EPiServer.Web.Mvc.Html.ContentAreaRenderer, EPiServer.Cms.AspNet, Version=11.18.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]],EPiServer.Framework, Version=11.18.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7

EPiServer.Web.Mvc.Html.ContentAreaRenderer,EPiServer.Cms.AspNet, Version=11.18.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7

Is that what you'd expect to see here for the default ContentAreaRenderer?

Also, our packages are targeting .Net Framework 4.6.1 instead of 4.8, if that matters at all.

valdisiljuconoks commented 3 years ago

Exactly - no, this is not correct renderer. You could sneak peek into Bootstrap renderer init module and see which class should be set and renderer. And can try to implement your own initialization module and copy/paste code from library. Maybe there is something wrong with module invoke and renderer is not set - which explains why you see no changes in HTML.

brb72 commented 3 years ago

Sorry, I had thought the Nuget package would add that initialization module. I just added a new class called "SetupBootstrapRenderer.cs" in our InitializableModules folder, using the file you referenced (I only changed the namespace to match our project).

I am seeing two errors:

image

image

valdisiljuconoks commented 3 years ago

Indeed, library is adding required initialization and usually no addition setup is required. You can try it in simple Alloy Tech sample site. Regarding your errors - this is due to some stuff is still kept internal. You can mock it and replace it with some hard-coded stuff.

brb72 commented 3 years ago

Hm, I did try extracting the needed code from the repo here and using that to workaround the errors, however it created more errors. Unfortunately, we're doing a whole site redesign and I don't have too much time to dive into all the errors.

This is a great project and would be an awesome feature for our editors, so I will definitely be back in the future to figure this out! Thank you for your time and efforts looking into this ticket.