dd4t / dd4t.mvc Goto Github PK
View Code? Open in Web Editor NEWDD4T MVC .NET Support
License: Apache License 2.0
DD4T MVC .NET Support
License: Apache License 2.0
If a component presentation is dynamic (in other words: loaded directly from the broker, not from the page), the IsRepositoryPublished and IsQueryBased are both set to true by the XpmMarkupService. This is not correct, because CPs can be dynamic without being query-based. This is the case when a component template is marked as 'publish as a dynamic component' but also 'allow to be embedded on a page'.
As a result, a DCP which is embedded on the page cannot be moved around, like you can with a completely static CP.
To solve this, we probably need to add an overload to the StartXpmEditingZone, because by looking at the viewmodel it isn't possible to tell if it was created as a result of a query.
If you fail to configure Controller or Action in the app settings, or in your component template, the DefaultComponentPresentationRenderer throws an argument exception. This could be improved by a more explicit exception
Right now, the page markup has to be written out very differently from component and field markup. Let's align this.
When a binary is requested using the BinaryDistributionModule or through a BinaryController, the path in the request is temporarily rewritten to /BinaryData/*. At the end of a successful request, it is rewritten again to the original path. But when the request is not successful, e.g. when the binary cannot be found in Tridion, the path in the request stays on '/BinaryData...'. Although you don't notice this in the browser (it is a server-internal process), you do notice it if you have other handlers / modules in the pipeline which do something with the request. One example is a Friendly Url module, which looks up '404' requests in a list of friendly url definitions.
We need to make sure the path is always reset to the original, even if the binary cannot be found.
If a user requests a URL with double slashes (like http://www.acme.org//my//page.html), the URL should be normalized (into http://www.acme.org/my/page.html) before it is requested from the broker API. This is standard behaviour of most web servers.
This should become part of the 'add welcome file' logic in the DD4TControllerBase.
Optionally we could add support for extensionless urls as well.
If you call StartXpmEditingZone on a model that represents a linked component (rather than a component presentation), an empty string is returned. This is a shame because Tridion allows you to edit fields inside linked components if you just add a (nested) ComponentPresentation XPM comment. The template part is simply ignored.
To solve, we need to overload the StartXpmEditingZone with a parentModel (an IViewModel which contains a component template).
The code here:
https://github.com/dd4t/DD4T.MVC/blob/develop/source/DD4T.Mvc/Html/TridionHelper.cs#L99
is clearly intended to ensure that a non-null value of 'page' is passed to
MvcHtmlString output = renderer.ComponentPresentations(page, helper, byComponentTemplate, bySchema);
at line 115.
The assumption is that evaluating: helper.ViewContext.Controller.ViewBag.Page will throw if no page is available ,however it can simply evaluate to null without throwing.
Steps to reproduce:
Class should contain the defaults that will be set by on of the DD4T.DI.*
Example:
var mappings = new Dictionary<Type, Type>();
mappings.Add(typeof(IMessageProvider), typeof(JMSMessageProvider));
return mappings;
In DD4T.Mvc\ViewModels\XPM\Contracts.cs, the namespace is defined as
DD4T.MVC.ViewModels.XPM
This is inconsistent with the namespacing scheme used in the rest of DD4T, where 'Mvc' is used rather than 'MVC'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.