Try our conversational search powered by Generative AI!

How to load custom view in preview ContentPreview iFram

Vote:
 

http://world.episerver.com/documentation/JavaScript-Library/?documentId=CMS/10/epi-cms/contentediting/ContentPreview
I'm trying to load custom view in preview contennair/iFrame using above ContentPreview dojo digit. however can't get iFram.Load working. Getting Iframe as NULL.

Any Help?

/K

#172200
Nov 25, 2016 18:01
Vote:
 

Hi Khan, I think you can achive this bye following  epi/shell/widget/Iframe. 

  • Used iframe wiget and load url in widget
  • Then place this new widget into ContentPreview widget

There is example code however you can get ContentPreview node by using data-dojo-attach-point="previewContainer" 

Hope this works

/asimz

define([
    'dojo/_base/declare',
    'dojo',
    'epi/shell/widget/Iframe'
], 
function (declare, dojo, Iframe) {
   
    return declare([Iframe], {
        baseUrl: null,
        buildRendering: function () {
            this.inherited(arguments);
        },
        onClick: function () {
            this.baseUrl = "http://world.episerver.com/";
            this.updateView()
        },
        updateView: function () {
            var tc = dojo.query('.epi-editorViewport-previewBox')[0];
            this.load(this.baseUrl, null);
            dojo.place(this.iframe, tc, 'only');
        }
    });
});

 

#172201
Edited, Nov 26, 2016 11:15
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.