Sign in

Tag script js

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #3736
    Paolo

    Hi
    i’m working on moving my site to publii
    I have two questions to ask you

    First question
    in the Block editor the js script tag does not work

    Second question
    in a script tag how to refer to a folder to recall a js function without writing it in the page?

    Thank you very much

    Paolo

    #3737
    BobBob
    Support

    in the Block editor the js script tag does not work

    What exactly isn’t working?

    in a script tag how to refer to a folder to recall a js function without writing it in the page?

    https://getpublii.com/dev/js-helper/

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #3738
    Paolo

    Thanks Bob
    i mean the with block editor js code is not executed
    I send you three examples made with different editors
    where you see that with the block editor
    the js code remains text

    http://test.allenati.it/block.html
    http://test.allenati.it/mark.html
    http://test.allenati.it/prova-wisnsing.html

    #3739
    BobBob
    Support

    use an HTML block if you want to execute the script instead of a “script” block which only displays the script.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #3746
    Paolo

    Thanks Bob
    I confirm that in the Block editor, I use the HTML icon and put the script
    between the tags p and p of the html block.
    But then if I look at the online code of the generated post
    “script” becomes “publii-script” and is not interpreted correctly.
    What am I doing wrong? Thanks for your help

    #3751
    BobBob
    Support

    Its a bug in the HTML block, it will be fixed in the upcoming Publii version (most probably publish next week) https://github.com/GetPublii/Publii/issues/815

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #3752
    Paolo

    Thanks a lot Bob

    One more about {{js “filepath.js”}} in https://getpublii.com/dev/js-helper/
    I am trying to use the link to the assets directory (which one? Because there are several) e.g \ input \ themes \ simple \ assets \ js?

    #3753
    BobBob
    Support

    This helper is always looking for the script file in the following localization: ‎⁨(Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME ▸ assets ▸ js)

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #3757
    Paolo

    I’m trying to link the w3.js file I put in the foder
    “Documents \ Publii \ sites \ mysite \ input \ themes \ simple \ assets \ js \”
    with the helper src=”{{js” w3.js “}}”
    but it doesn’t work locally
    and in the generated html code remains src=”{{js” w3.js “}}”
    see http://test.allenati.it/helper.html
    can you help me understand the problem
    thank you

    #3758
    BobBob
    Support

    It needs to be embedded in the source files like head.hbs, footer.hbs, or any other, not in the post body.

    <script src="{{js "w3.js"}}"></script>
    

     

     

     

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.