0

There is a small problem when I try to add web part inside a blogpost body.

There is no parts group (App Part and Web Part buttons) when I am updating the blogpost list item.

What I tried

1) I thought it is related to RTE because parts group is visible within an application page. And these commands are working for another RTE within a application page. But it is not working with the rich html columns while creating or editing a list item.

var rte = RTE.Canvas.currentEditableRegion();

RTE.Canvas.setRestriction(rte,RTE.Canvas.allowWebParts,true);

RefreshCommandUI();

2) And also I tired to get instance of this command (Ribbon.WebPartInsert) to show it on Ribbon Area. Now it is visible, but not enabled.

EnableWebPartInsertTab = new function () {
    var originalRibbonInit = window._ribbonInitFunc1Wrapped;
    var l0, l1, l2, l3, l4, l5, l8, l9, l10, l11, l12, l13, l14, l15, l18, l20, l21, l24, l27, l28, l29;

    this._init = function () {

        window._ribbonInitFunc1Wrapped = function (p0, p1, p2, p3, p4, p5, p8, p9, p10, p11, p12, p13, p14, p15, p18, p20, p21, p24, p27, p28, p29) {
            p10["Ribbon.EditingTools.CPInsert.WebParts"] = false;
            p8["Ribbon.WebPartInsert.Tab"] = true;

            l0 = p0;
            l1 = p1;
            l2 = p2;
            l3 = p3;
            l4 = p4;
            l5 = p5;
            l8 = p8;
            l9 = p9;
            l10 = p10;
            l11 = p11;
            l12 = false;
            l13 = p13;
            l14 = p14;
            l15 = p15;
            l18 = p18;
            l20 = p20;
            l21 = p21;
            l24 = p24;
            l27 = p27;
            l28 = p28;
            l29 = p29;

            originalRibbonInit(l0, l1, l2, l3, l4, l5, l8, l9, l10, l11, l12, l13, l14, l15, l18, l20, l21, l24, l27, l28, l29);

        };
    }

    this.Refresh = function () {
        originalRibbonInit(l0, l1, l2, l3, l4, l5, l8, l9, l10, l11, l12, l13, l14, l15, l18, l20, l21, l24, l27, l28, l29);
    }
}

  ExecuteOrDelayUntilScriptLoaded(function () {
    EnableWebPartInsertTab._init();
}, "core.js");

Do you have any idea? Can't we use web parts in the list items columns?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.