• I created a simple lazy block:

    
    <p>Open <a href="https://foo.com/{{my_custom_id}}" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">here ({{my_custom_id}})</a>.</p>
    

    When I add the block in my post, it correctly tells me that my_custom_id is required.

    When I enter a value, it correctly update the editor view ( I have Single output code for Frontend and Editor checked ).

    When I click on preview or publish the article, instead of the value I entered, it is using the default value.

    I did not want a default value but I just put abc in the Lazy Block value to test that the interpolation with handlebars was working.

    And it must, since I am seeing abc in the website. But I do not see the value I entered in the editor.

    PS: I tried with {{ and with 3 as well. Both yield the same result.

    • This topic was modified 4 years, 7 months ago by leobsf.
    • This topic was modified 4 years, 7 months ago by leobsf.
    • This topic was modified 4 years, 7 months ago by leobsf.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nK

    (@nko)

    Hi.

    I don’t see such a problem on the test server. Please, could you export the block and share it? https://lazyblocks.com/documentation/export-blocks/

    Regards, nK.

    Thread Starter leobsf

    (@leobsf)

    Sure , it is super simple:

    
    [
        {
            "id": 1173,
            "title": "ScastieEmbed",
            "icon": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<rect opacity=\"0.25\" width=\"15\" height=\"15\" rx=\"4\" transform=\"matrix(-1 0 0 1 22 7)\" fill=\"currentColor\" \/>\n<rect width=\"15\" height=\"15\" rx=\"4\" transform=\"matrix(-1 0 0 1 17 2)\" fill=\"currentColor\" \/>\n<\/svg>\n",
            "keywords": [
                "scastie"
            ],
            "slug": "lazyblock\/scastie-embed",
            "description": "Scastie block",
            "category": "widgets",
            "category_label": "widgets",
            "supports": {
                "customClassName": true,
                "anchor": false,
                "align": [
                    "wide",
                    "full"
                ],
                "html": false,
                "multiple": true,
                "inserter": true
            },
            "ghostkit": {
                "supports": {
                    "spacings": false,
                    "display": false,
                    "scrollReveal": false
                }
            },
            "controls": {
                "control_250b7742ac": {
                    "type": "text",
                    "name": "scastie_id",
                    "default": "abc",
                    "label": "scastieID",
                    "help": "scastie ID from https:\/\/scastie.scala-lang.org\/",
                    "child_of": "",
                    "placement": "inspector",
                    "width": "100",
                    "hide_if_not_selected": "true",
                    "save_in_meta": "true",
                    "save_in_meta_name": "scastie_id",
                    "required": "true",
                    "placeholder": "Scastie ID",
                    "characters_limit": "22"
                }
            },
            "code": {
                "editor_html": "<p>Give it a try: {{scastieid}}<\/p>\n<script src=\"https:\/\/scastie.scala-lang.org\/{{scastieid}}.js\"><\/script>\n<p>Or directly on <a href=\"https:\/\/scastie.scala-lang.org\/{{scastieid}}\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Scastie<\/a>.<\/p>",
                "editor_callback": "",
                "editor_css": "",
                "frontend_html": "<p>Give it a try:<\/p>\n<script src=\"https:\/\/scastie.scala-lang.org\/<code>scastie_id</code>.js\"><\/script>\n<p>Or directly on <a href=\"https:\/\/scastie.scala-lang.org\/<code>scastie_id</code>\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Scastie (<code>scastie_id</code>)<\/a>.<\/p>",
                "frontend_callback": "",
                "frontend_css": "",
                "show_preview": "always",
                "single_output": true,
                "use_php": false
            },
            "condition": []
        }
    ]
    
    Thread Starter leobsf

    (@leobsf)

    The preview inside the block editor is correct but when i am in the preview, the default value is used instead of what i entered

    Thread Starter leobsf

    (@leobsf)

    It might be a conflict with another plugin. But not sure which one.

    Plugin Author nK

    (@nko)

    Hi.

    I see you checked the “Save in meta” control option. If you want to use it, read here how – https://lazyblocks.com/documentation/examples/display-custom-fields-meta/.

    Most probably you just need to uncheck this option.

    Regards, nK.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Block do not save the control value’ is closed to new replies.