• Resolved Ben Hutchings

    (@benmeredevelopmentcouk)


    Firstly, this plugin is great work! It’s saved me a ton of hacking.

    I’ve included an animation using the template inclusion method and would like to know if I can call a specific ID using that method the same way can with shortcodes?
    If not, something like: echo edge_suite_view([ID]); would be nice and easy to use if you could add that functionality.

    Cheers!
    Ben

    https://www.ads-software.com/extend/plugins/edge-suite/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ti2m

    (@ti2m)

    Hi Ben,
    thanks for the feedback. I’m not a big fan of including JS files inline within the body tag. At the moment this happen with shortcode proessing, but I’m thinking about changing that. With a direct call – like you are asking for – there would be no way around that, as there is no way to tell wp_head() to place the according JS files within the head tag. I dislike that as much as I dislike iframes, BUT of course it might make sense in some scenarios:

    Basically all you need is edge_suite_comp_render(id), which will return an array with keys ‘stage’ and ‘scripts’ (an array as well). You can put that together in a function:

    function edge_suite_view_inline($definition_id, $css_style = ''){
    
      $definition_res = edge_suite_comp_render($definition_id, $css_style);
    
      $stage = $scripts = '';
    
      if($definition_res != NULL){
        $scripts = implode("\n", $definition_res['scripts']);
        $stage = $definition_res['stage'];
      }
    
      return "\n" . $scripts . "\n" . $stage ."\n";
    }

    I’ll wait until I have figured out what to do with shortcodes before I’ll add the function to the plugin, otherwise I might have to change the function call later on. This could break stuff for people like you.

    Hope that helps

    Plugin Author ti2m

    (@ti2m)

    Marking this as solved, let me know if you need any more assistance. I added the feature request to the roadmap on trello.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Call ID for template based inclusion?’ is closed to new replies.