How do I add a new theme in Live Blog?
  • Howdy,

    I tried to duplicate the default directory and default.js+default.min.js to  and called the directory varden and the files to varden.js + varden.min.js. I also tried to build the egg-files(?) again and restart live blog but I'm not seeing my new theme as an option in the admin gui.

    Is there something I'm missing? I've read the "How to create themes" blog and watched all three videos on YouTube about this but I can't seem to figure it out.
  • 2 Comments sorted by
  • Just as a head's up
    Theme management is not yet implemented, we will implement this feature in the near feature.

    Now so for the theme to be visible in admin area after you created you will need to do the following steps:

    a) For a fresh install add the theme in the populate python file located here:
           Line 29 add the {THEME_NAME}

    b) For a already installed instance make a ajax request:
    {
            type: 'POST',
            url: 'http://{SERVER_NAME}/resources/LiveDesk/BlogTheme/',
            data: {
                Name: '{THEME_NAME}',
                URL: 'content/lib/livedesk-embed/themes/{THEME_NAME}'
            }
    }
    or with Postman request POST to 
    http://{SERVER_NAME}/resources/LiveDesk/BlogTheme/
       Name {THEME_NAME}
       URL   content/lib/livedesk-embed/themes/{THEME_NAME}

    Also if you use the egg file don't forget to add the needed __init__.py files into folders.

    PS: the theme work even if is not visible in the admin area ex:
    http://{SERVER_NAME}/content/lib/livedesk-embed/index.html?theme={THEME_NAME}

    or in the embed code:
    <div id="livedesk-root-container"></div><script type="text/javascript">/* <![CDATA[ */var liveblog = (function(d){var self = this;self.data = {id: 1,el: '#livedesk-root-container','language': 'en',theme: '{THEME_NAME}',script: d.scripts[d.scripts.length - 1],frontendServer: '//{SERVER_NAME}'};self.data.baseUrl = self.data.frontendServer + '/content/lib/livedesk-embed/scripts/js/';self.data.loadJs = function(path) {var ls = d.createElement('script'), s = d.getElementsByTagName('script')[0];ls.type = "text/javascript"; s.async = true;ls.src = path.indexOf('//') === -1 ? self.data.baseUrl + path + '.js?version=' + (self.data.version || parseInt((new Date()).getTime()/600000)):path;s.parentNode.insertBefore( ls, s ); return ls;};self.data.loadJs('loader');return self.data;})(document);/* ]]> */</script>
  • Thanks! It worked using the Postman app in Chrome. One problem solved is one step closer to the finishline :-)