• Hi nK,

    1. It seems that there is no way to have multiple paragraphs, or line breaks in the Textarea or the Code fields. If there is a way to do so, I don’t think your documentation is displaying it. Without line breaks the Code field is almost useless, since any chunk of code is compressed into a few lines of code, which becomes very hard to follow and understand.

    2. Also, your documentation on Shortcode + Gutenberg is incorrect, it has 3 opening and closing brackets instead of 2, and the # sign is missing before the “do_shortcode.

    3. Are we allowed to use php code in the handlebars?

    4. Final question (for today): Are we allowed to use the {{#do_shortcode ‘my_shortcode’ this}} ALSO in the Editor HTML, or that is only for the Front HTML?

    Thanks.
    Nick.

    P.S. I thankfully found this plugin 3 days ago, and already build 16 incredible Gutenberg blocks !!! I’m transforming from a Gutenberg hater to a Gutenberg lover… thanks to you !

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author nK

    (@nko)

    Hi Nick.

    1. If you use Text Area or Code Editor, paragraphs and line break tags will not be added automatically. You need to write it by yourself: <br>.

    In 1.1.1 plugin update added a new field called Rich Text, where you can edit text in WYSIWYG editor.

    2. Not sure, but {{# used in this way: {{#helper}}inner content{{/helper}}. To use do_shortcode helper, inner content is not used, so we need to call it {{do_shortcode 'my_shortcode' this}} OR {{{do_shortcode 'my_shortcode' this}}} to properly output HTML.

    3. PHP code only may be used for frontend code and only as part of registered helpers. There is no way to extend it for now.

    4. do_shortcode helper is only for the frontend. Gutenberg has functionality for PHP code inside blocks, but they don’t recommend using it.

    Thank you ??

    Thread Starter nick6352683

    (@nick6352683)

    Thanks for the reply nK, (refer to the original questions)

    1. When I manually add the tags (<br>) the tags are echoed (shown) on the front end, and not executed. This is the same issue with the new WYSIWYG field type. The tags are shown and not executed. I will start a new support issue for it…

    2. I will make a quick video for you here shortly to see that adding the # before the do_shortcode works, and not having it fails…

    3. Any examples will be greatly appreciated as I’m totally new to handlebars and helpers. For years I was doing php shortcodes before all this!

    4. Got it, thanks.

    Thanks again…

    Thread Starter nick6352683

    (@nick6352683)

    Ok, here is the only way to execute shortcodes, any other way it does not work… this is from issue #2 from above…

    Click to see the video

    Thanks.

    Plugin Author nK

    (@nko)

    1. If you need to escaped text, you use {{my_control}}, for HTML use {{{my_control}}}. See example https://handlebarsjs.com/#html-escaping

    2. Yeah, I know it is working, but on my test site it had a little bug (I don’t remember what exactly) and this one solved it {{{do_shortcode 'my_shortcode' this}}}

    3. I’ll add in documentation information on how to create your own helpers. Currently, there are a small number of predefined helpers – https://lazyblocks.com/documentation/blocks-code/handlebars/

    p.s. What functionality in the building blocks is not enough for you? Maybe you can suggest Handlebars helpers, that I can add in addition to already created.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue with Text area and Code fields’ is closed to new replies.