AnsweredAssumed Answered

How to load Sugar 7 Sidecar on an entryPoint page?

Question asked by Chad Hutchins on Jan 2, 2017

What I'd like to do is use the sidecar framework on an entryPoint, so ideally I'd have a blank page, but I could still have access to all of the sidecar functionality (like app.api.call and app.api.buildURL so that I can make calls to the system) but I would like to completely control the interface.

 

Just looking at the generated html of a Sugar 7 page gives me most of what I need, but it just doesn't feel like the "right" way to do it. The following works:

 

<html><body>
    <script type="text/javascript" src="include/javascript/modernizr.js"></script>
    <script type="text/javascript" src="sidecar/minified/sidecar.min.js"></script>
    <script src='cache/include/javascript/sugar_sidecar.min.js'></script>
    <script src='cache/Expressions/functions_cache.js'></script>
    <script src='cache/config.js?hash=$configHash'></script>
    <script type="text/javascript" src="cache/include/javascript/sugar_grp7.min.js"></script>

    <script>
        var App;
        App = SUGAR.App.init({
            callback: function(app){
                app.api.call('GET',app.api.buildURL('ping'),{},{
                    success:function(data){
                        console.log(data);
                    }
                },{});
            }
        });
     </script>
</body></html>

 

Is there a better way to do this? Or is manually adding in the script headers at the best way to do this right now?

 

Thanks!

Outcomes