Comments (10)
Can you check in IoC (StructureMap) which Content area renderer is registered? Easily visible via Episerver Developer Tools
from optimizely-advanced-contentarea.
Thanks for the reply!
When I try to install the DeveloperTools in the Episerver project using nuget the project builds ok but I get an error saying that the file could not be loaded when loading the website. Using version 3.5. Tried using Alloy with Episerver 11.12 as well.
"Could not load file or assembly 'EPiServer.DeveloperTools' or one of its dependencies. The system cannot find the file specified."
Regarding the EPiBootstrapArea, it seems to be the correct content area renderer registered since other EPiBootstrapArea functionality is working.
from optimizely-advanced-contentarea.
I tried to install EPiBootstrapArea using an empty Alloy website and there it seems to be working, at least in the basic configuration. I'll try and troubleshoot if there's any EPiBootstrapArea configuration that might interfere.
from optimizely-advanced-contentarea.
Ok that's weird for developertools. I'll take a look later.
If it's working correctly in alloy - might be some config in your project.
Do you advanced-cms content review plugin? if so - you might need to jump to latest there as well.
from optimizely-advanced-contentarea.
No, not using the advanced-cms content review plugin but thinking about it. Thanks for the tip.
The thing that seems to happen in the BlockIndex htmlhelper is that htmlHelper.ViewData does not contain any keys so looking for the "BootstrapContentArea__BlockIndex" will return -1.
Regarding dependency injection, I take it that BootstrapAwareContentAreaRenderer sets up it's own DI in the SetupBootstrapRenderer class, so no manual DI configuration is needed, is this correct?
from optimizely-advanced-contentarea.
Yes, that's correct, no manual DI is needed.
from optimizely-advanced-contentarea.
For me changing the code like this make it works again:
public static DisplayOption GetDisplayOption(this HtmlHelper htmlHelper, BlockData block)
{
if(htmlHelper == null)
throw new ArgumentNullException(nameof(htmlHelper));
if(block == null)
throw new ArgumentNullException(nameof(block));
return htmlHelper.ViewContext.ParentActionViewContext.ViewData.ContainsKey(Constants.CurrentDisplayOptionKey)
? htmlHelper.ViewContext.ParentActionViewContext.ViewData[Constants.CurrentDisplayOptionKey] as DisplayOption
: null;
}
I guess it's because in our project, we're using dedicate block controller instead of just registering a block with a partial view.
from optimizely-advanced-contentarea.
v5.3 is on the way to the feed
from optimizely-advanced-contentarea.
If others have similar issues, it could be custom block controllers messing this up.
I ended up reading the value in the controller and extending the BlockViewModel
.
Maybe there is some way to pass ViewData
from ParentActionViewContext
on to make the Html.GetIndex()
-helper work, but didn't investigate it any further.
[TemplateDescriptor(Default = true, Inherited = true)]
public class DefaultBlockController : BlockController<BaseBlockData>
{
public override ActionResult Index(BaseBlockData currentBlock)
{
var model = CreateModel(currentBlock);
var blockName = currentBlock.GetOriginalType().Name;
model.BlockIndex = int.Parse(ControllerContext.ParentActionViewContext.ViewData["BootstrapContentArea__BlockIndex"]?.ToString() ?? "-1");
return PartialView(string.Format("~/Features/Blocks/{0}/{1}.cshtml", blockName, blockName), model);
}
private static IBlockViewModel<BlockData> CreateModel(BlockData currentBlock)
{
var type = typeof(BlockViewModel<>).MakeGenericType(currentBlock.GetOriginalType());
return Activator.CreateInstance(type, currentBlock) as IBlockViewModel<BlockData>;
}
}
from optimizely-advanced-contentarea.
from optimizely-advanced-contentarea.
Related Issues (20)
- CVE-2022-34716 (Medium) detected in system.security.cryptography.xml.4.4.2.nupkg, system.security.cryptography.xml.4.4.0.nupkg
- WS-2022-0161 (High) detected in newtonsoft.json.9.0.1.nupkg, buildbundlerminifier.3.2.449.nupkg
- CVE-2018-1285 (High) detected in log4net.2.0.8.nupkg
- CVE-2020-1045 (High) detected in microsoft.aspnetcore.http.2.0.0.nupkg
- Add Support for V12 HOT 2
- CVE-2021-26701 (High) detected in system.text.encodings.web.4.4.0.nupkg
- CVE-2022-41064 (Medium) detected in system.data.sqlclient.4.4.0.nupkg
- Trying to add this package in CM 12.23.0 and getting dependency injection error HOT 1
- No additional HTML rendered after package install HOT 8
- CVE-2021-23369 (High) detected in handlebars-1.3.0.tgz - autoclosed HOT 1
- CVE-2021-23383 (High) detected in handlebars-1.3.0.tgz - autoclosed HOT 1
- CVE-2017-16116 (High) detected in underscore.string-2.3.3.tgz - autoclosed HOT 1
- CVE-2021-32804 (High) detected in tar-0.1.20.tgz - autoclosed HOT 1
- CVE-2021-23413 (Medium) detected in jszip-2.5.0.tgz - autoclosed HOT 1
- CVE-2018-8292 (High) detected in system.net.http.4.3.0.nupkg
- CVE-2019-0820 (High) detected in system.text.regularexpressions.4.3.0.nupkg
- CVE-2017-0256 (Medium) detected in system.net.http.4.3.0.nupkg - autoclosed HOT 1
- CVE-2017-0247 (High) detected in system.net.http.4.3.0.nupkg - autoclosed HOT 1
- CVE-2017-0248 (High) detected in system.net.http.4.3.0.nupkg - autoclosed HOT 1
- CVE-2017-0249 (High) detected in system.net.http.4.3.0.nupkg - autoclosed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optimizely-advanced-contentarea.