Announcement

Collapse
No announcement yet.

{{plugin_function is not called from html file? Any ideas what could be wrong?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dmurphy
    replied
    Originally posted by alexbk66 View Post
    That's what I have:
    HTML Code:
    <!DOCTYPE html>
    <html lang=""en"">
    <head>
    <meta charset = ""utf-8"" >
    <meta http-equiv=""X-UA-Compatible"" content=""IE=edge"">
    <!--This maintains the scale of the page based on the scale of the screen-->
    <meta name = ""viewport"" content=""width=device-width, initial-scale=1"">
    <meta name = ""author"" content=""ABK"">
    <!--This liquid tag loads all of the necessary css files for HomeSeer-->
    {{includefile '/bootstrap/css/page_common.css'}}
    <link href='/#ID#/abk.css' rel='stylesheet'>
    <title>
    {{ plugin_function '#ID#' 'GetTitle' ['#PAGE#'] }}
    </title>
    </head>
    Solved.......user error

    I had implemented the scheme above to allow creation of html within the c# code.

    {{plugin_function '#ID#' 'GetHTML' ['#PAGE#'] }}

    BUT you cannot embed

    Code:
    <div class="col-md-7">
        {{plugin_function 'HS4Test' 'GetPluginVersion' []}}
    </div>
    in the html produced as it doesn't get evaluated recursively......doh

    Leave a comment:


  • dcorsus
    replied
    Originally posted by dmurphy View Post

    Yes the page is registered and available with HS....
    Yes the page otherwise registers correctly
    Yes it is .html
    Yes scriban.dll (11/15/2019) is in bin/homeseer

    and weirdly the SamplePlugin renders correctly.....and processes the plugin_function
    do you mind post the whole file, I'll try it against my system, see if the issue is somewhere else

    Leave a comment:


  • dmurphy
    replied
    Originally posted by rmasonjr View Post
    Instead of [] try ['0']
    No change, seems either is valid.

    Leave a comment:


  • rmasonjr
    replied
    Instead of [] try ['0']

    Leave a comment:


  • dmurphy
    replied
    Originally posted by dcorsus View Post
    Ususally when there is something wrong with the tag, your page doesn't render at all, it gives you gobbledy gook. Given it shows in plain text and the rest renders properly (is that correct), I would venture the page isn't being processed by scriban.

    Some questions:
    - you have this page rendered by HS4, right? (meaning you have a registered link in your plugin) and that's what you use, not another webserver that might be in use?
    - is the file named .htm or .html, should be the latter?
    - the scriban.dll is located in the <hs root>\bin\homeseer directory, is it there? Nothing screwed up the dll directories?

    Just some pointers
    Yes the page is registered and available with HS....
    Yes the page otherwise registers correctly
    Yes it is .html
    Yes scriban.dll (11/15/2019) is in bin/homeseer

    and weirdly the SamplePlugin renders correctly.....and processes the plugin_function

    Leave a comment:


  • dcorsus
    replied
    Originally posted by rmasonjr View Post
    Also, hit F12 in chrome to see if there are any errors in the console.
    true, on the other hand, this is server side processing that seems not to happen for some reason

    Leave a comment:


  • ewkearns
    replied
    Originally posted by alexbk66 View Post

    OP is asking about Liquid tags in HTML page, but you are talking about scripting
    OK, that's a few semesters ahead of me, but looks very interesting. I don't think I can look at the example and the "description" and see a lot of commonalities, but then I know so little about it. Thanks for the information. Somehow, I feel like I am looking at the basics of the "New HSTouch Designer".

    Leave a comment:


  • rmasonjr
    replied
    Also, hit F12 in chrome to see if there are any errors in the console.

    Leave a comment:


  • dcorsus
    replied
    Ususally when there is something wrong with the tag, your page doesn't render at all, it gives you gobbledy gook. Given it shows in plain text and the rest renders properly (is that correct), I would venture the page isn't being processed by scriban.

    Some questions:
    - you have this page rendered by HS4, right? (meaning you have a registered link in your plugin) and that's what you use, not another webserver that might be in use?
    - is the file named .htm or .html, should be the latter?
    - the scriban.dll is located in the <hs root>\bin\homeseer directory, is it there? Nothing screwed up the dll directories?

    Just some pointers

    Leave a comment:


  • alexbk66
    replied
    Originally posted by ewkearns View Post
    I'm just beginning to begin to begin learning this stuff, but I think you may have to say "hs.plugin_function"
    OP is asking about Liquid tags in HTML page, but you are talking about scripting

    Leave a comment:


  • ewkearns
    replied
    I'm just beginning to begin to begin learning this stuff, but I think you may have to say "hs.plugin_function"

    This may help:

    https://forums.homeseer.com/forum/de...on#post1388632

    Leave a comment:


  • alexbk66
    replied
    Github then

    Leave a comment:


  • dmurphy
    replied
    That's what is in the sample plugin also.....something is wrong, but the system provides no indication of what, so fixing is a bummer as I don't know where to start. I've spent two days tweaking and twiddling the html to no avail.....

    Leave a comment:


  • alexbk66
    replied
    That's what I have:
    HTML Code:
    <!DOCTYPE html>
        <html lang=""en"">
        <head>
            <meta charset = ""utf-8"" >
            <meta http-equiv=""X-UA-Compatible"" content=""IE=edge"">
            <!--This maintains the scale of the page based on the scale of the screen-->
            <meta name = ""viewport"" content=""width=device-width, initial-scale=1"">
            <meta name = ""author"" content=""ABK"">
            <!--This liquid tag loads all of the necessary css files for HomeSeer-->
            {{includefile '/bootstrap/css/page_common.css'}}
            <link href='/#ID#/abk.css' rel='stylesheet'>
        <title>
            {{ plugin_function '#ID#' 'GetTitle' ['#PAGE#'] }}
        </title>
        </head>

    Leave a comment:


  • {{plugin_function is not called from html file? Any ideas what could be wrong?

    I have this in a html file.....

    Code:
    <div class="col-md-7">
    {{plugin_function 'HS4Test' 'GetPluginVersion' []}}
    </div>
    But instead of the plugin_function getting called in my plugin the plaintext is presented in the browser.....Any ideas I'm stumped.

    What does plugin_function depend upon?

    If it fails where does it present that information?
Working...
X