Comments (4)
Can you elaborate on the use cases for customizing the XPM markup? Given your proposed design, it seems you have several use cases in mind.
Would it be an option to let PageModel.GetXpmMarkup() call GetXpmScriptMarkup(), which calls GetXpmScriptUrl() in turn (and let DxaPageMarkup() only call PageModel.GetXpmMarkup()) ?
from dxa-web-application-dotnet.
A customization I am working now is to delay loading the XPM script.
Usually the XPM script loads after the page is parsed using <script type="text/javascript" language="javascript" defer="defer" src="https://server/WebUI/Editors/SiteEdit/Views/Bootstrap/Bootstrap.aspx?mode=js" id="tridion.siteedit"></script>
. We are using Vue (a frontend scripting framework) to render some views on the frontend. To make sure that XPM components and fields which are inside those Vue views are rendered correctly, we load the XPM script when Vue has rendered all Vue components and the mounted() hook is called.
The XPM page metadata (the XPM HTML comments) can be loaded like usual, but the XPM JavaScript script cannot be loaded with the <script>
tag outputted by GetXpmMarkup()
. For now I have a custom view helper which renders just the XPM page metadata. A PageModel extension provides the XPM script URL which is passed to the Vue configuration.
from dxa-web-application-dotnet.
@rpannekoek: about the DxaPageMarkup()
and other methods. Why not separate the XPM page metadata and the script tag? They do not have to be rendered by the same helper method because they are separate things. The XPM page metadata is similar to the XPM component metadata, it is fine to leave it to the page view or the _Layout view. The XPM script tag could be loaded elsewhere, depending on the implementation.
- The XPM page markup will be generated by the DxaPageMarkup() helper, calling PageModel.GetXpmMarkup()
- The XPM script markup will be generated by the DxaScriptMarkup() helper, calling PageModel.GetXpmScriptMarkup(), which calls PageModel.GetXpmScriptUrl()
from dxa-web-application-dotnet.
Has there been any resolution to this issue/suggestion or is this fixed in DXA 2.0 or will it be in DXA 2.1 ?
from dxa-web-application-dotnet.
Related Issues (20)
- Threading issue within localization resolver when caching is disabled
- DXA1.6 web solution (dxa-web-application-dotnet-DXA_1.6_Release.zip) HOT 1
- Language selector URL does not expect null page id HOT 2
- Use precompiled views HOT 1
- Have DXA sources in a symbol server HOT 2
- Only possible to embedded MediaItem entities in Rich Text fragments HOT 2
- Component Link mapping fails after link depth reached in web application. HOT 2
- Model Service (R2) ComponentTemplate missing from DCP(s) HOT 3
- ModelServiceClient ArgumentNullException crash HOT 2
- HtmlHelper null pointer exceptions HOT 3
- Ambiguous DXA exception for PCA DXA model addon
- Keyword Model extensions are not supported without a Metadata Schema
- RichText model extensions are not supported
- Output Cache is caching even if there is an error on the page HOT 1
- can DXA Container Framework be extended to support DXA 2.2 on Tridion 9/9.1
- Images with spaces return 404
- BinaryFileManager - StripDimensions UrlDecode ran only when no dimensions HOT 1
- MimeMapping.GetMimeMapping returns wrong mime types
- reuse HttpClient object / SNAT port exhaustion HOT 1
- Outputcache empty content after redirect HOT 2
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 dxa-web-application-dotnet.