• Resolved girard176

    (@girard176)


    Hi,

    I’m trying to embed an excel file from onedrive with the following Javascript :
    <div id=”myExcelDiv” style=”width: 700px; height: 377px”></div>
    <script type=”text/javascript” src=”https://r.office.microsoft.com/r/rlidExcelWLJS?v=1&kip=1″></script&gt;
    <script type=”text/javascript”>
    /*
    * This code uses the Microsoft Office Excel Javascript object model to programmatically insert the
    * Excel Web App into a div with id=myExcelDiv. The full API is documented at
    * https://msdn.microsoft.com/fr-FR/library/hh315812.aspx. There you can find out how to programmatically get
    * values from your Excel file and how to use the rest of the object model.
    */

    // Use this file token to reference Weight to HP.xlsx in Excel’s APIs
    var fileToken = “SD601E4D5C3EF598BF!215/6926058335531014335/t=0&s=0&v=!ABBpbK18hguDBgw”;

    // run the Excel load handler on page load
    if (window.attachEvent) {
    window.attachEvent(“onload”, loadEwaOnPageLoad);
    }} else {{
    window.addEventListener(“DOMContentLoaded”, {6}, false);
    }}

    function {6}() {{
    {7}

    Ewa.EwaControl.loadEwaAsync(fileToken, “myExcelDiv”, props, {8});
    }}

    function {8}(result) {{
    /*
    * Add code here to interact with the embedded Excel web app.
    * Find out more at {3}.
    */
    }}
    </script> else {
    window.addEventListener(“DOMContentLoaded”, loadEwaOnPageLoad, false);
    }}

    function {6}() {{
    {7}

    Ewa.EwaControl.loadEwaAsync(fileToken, “myExcelDiv”, props, {8});
    }}

    function {8}(result) {{
    /*
    * Add code here to interact with the embedded Excel web app.
    * Find out more at {3}.
    */
    }}
    </script>

    function loadEwaOnPageLoad() {
    var props = {
    item: “‘Feuil1’!A1:D10”,
    uiOptions: {
    showDownloadButton: false,
    showGridlines: false,
    selectedCell: “‘Feuil1’!D3”,
    showParametersTaskPane: false
    },
    interactivityOptions: {
    allowParameterModification: false,
    allowSorting: false,
    allowFiltering: false,
    allowPivotTableInteractivity: false
    }
    };

    Ewa.EwaControl.loadEwaAsync(fileToken, “myExcelDiv”, props, onEwaLoaded);
    }}

    function {8}(result) {{
    /*
    * Add code here to interact with the embedded Excel web app.
    * Find out more at {3}.
    */
    }}
    </script>

    function onEwaLoaded(result) {
    /*
    * Add code here to interact with the embedded Excel web app.
    * Find out more at https://msdn.microsoft.com/fr-FR/library/hh315812.aspx.
    */
    }}
    </script>
    </script>

    When I create my code and name it CODE1 and saving it, I can’t manage to have it shown in the page. The only thing I’m seeing is the %CODE1%.

    Any idea?
    Thank you very much!

    https://www.ads-software.com/plugins/simple-embed-code/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author David Artiss

    (@dartiss)

    So you’re saving the code as a custom field named CODE1?

    David.

    Thread Starter girard176

    (@girard176)

    Yes!

    Plugin Author David Artiss

    (@dartiss)

    Can you save a screenshot of your settings page and send me a link?

    David.

    Thread Starter girard176

    (@girard176)

    The screenshot is now in the page :
    https://www.apexality.com/calculator

    Plugin Author David Artiss

    (@dartiss)

    That is VERY odd – everything is set up as it should be. Thanks for providing that, though.

    So, all my plugin does it looks at your post or page content, looking for the relevant code – in this case %CODE1%. The fact that it’s showing as that, and the code hasn’t been replaced, either means the replacement is failing due to the code you’ve provided (which I can check for later) OR it’s not in a standard WordPress format – i.e. it’s not in the content for it to find.

    In the screenshot I notice an odd text editing screen above the custom fields box. What is this? Was the %CODE1% added in this of the standard WordPress editor?

    David.

    Plugin Author David Artiss

    (@dartiss)

    Just tried in on my test site, btw, and the script doesn’t work anyway – you have an odd </script> just before…

    else {
    window.addEventListener("DOMContentLoaded", loadEwaOnPageLoad, false);

    David.

    Thread Starter girard176

    (@girard176)

    You got the thing, I switched from the page builder (Page Builder by SiteOrigin plugin) to the standard editor. Now CodeEmbed seems to be working but not my javascript, it’s showing weirdly. Do you have any idea?

    By the way, thanks a lot for the fast answer! ??

    Plugin Author David Artiss

    (@dartiss)

    See my earlier response – there’s an odd </script> in the middle of the code.

    David.

    Thread Starter girard176

    (@girard176)

    Thanks a lot for the fast answer, I’ll now be working on my code!

    Plugin Author David Artiss

    (@dartiss)

    You’re more than welcome. Good luck!

    David.

    I’m having a very similar problem.

    However my code doesn’t have the “<script>” things in the middle.

    I’ve been trying just a standard youtube video to see if it will work before I try adding my actual content. Nothing works and all that is displayed on my post is “%code%”.

    Can you help?!

    Guessing the fact only %code% is displayed on a page is likely because this plugin is not compatible with WP version 4.4.1?

    Plugin Author David Artiss

    (@dartiss)

    Nope, I just haven’t gotten around to updating the README ??

    You shouldn’t be placing %code% on the page, as it needs a number after it. Assuming you created a custom field named code1 then you need to add %code1% to your post.

    David.

    Keyword used in Code Embed Settings auto formats to UPPERCASE. The keyword is case sensitive within the page or post. Example: Keyword CODE must be %CODE1% and not %code1% otherwise all that is displayed is text string %code1%.

    Plugin Author David Artiss

    (@dartiss)

    A good point, yes, it should be capitals.

    David.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Only %CODE1% showing in page’ is closed to new replies.