Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    I’ve looked into this, and my first impression is that it doesn’t seem so efficient to use:

    [block class="test"]

    when the original is shorter:

    <div class="test">

    At the same time, I can imagine some enhanced features for blocks that could do more than a simple div. Please let me think about it some more – I appreciate the suggestion!

    By the way, I found in your github a repo for shortcode unautop. This could be useful to include in the plugin!

    Thread Starter Viktor Szépe

    (@szepeviktor)

    The main advatage of [block]-s are the visibility in Visual mode.
    So a client cannot mess it up so easily.
    <div class="test"> is hidden in Visual mode and a simple hit of the backspace eliminates the class.

    Thread Starter Viktor Szépe

    (@szepeviktor)

    This site is built with [blocks] and can be edited without HTML knowledge.

    You only have to pay attention not to delete a shortcode.

    Thread Starter Viktor Szépe

    (@szepeviktor)

    “shortcode unautop” is a must – for me – because WP generates stray </p>-s from block level element-generating shorcodes – which are invalid.

    Plugin Author Eliot Akira

    (@miyarakira)

    That’s a good point about visibility in Visual editor, it could be useful for some people. OK, I’ll add an option to turn on [block] shortcodes.

    About shortcode unautop – I had to struggle to solve the auto-formatting issue with multi-line shortcodes, especially [loop]. The most recent solution was to include an option in the plugin settings page, to move wpautop filter to after shortcodes are processed. With this enabled, it might not be necessary to include shortcode unautop. If you would care to try it, I’m curious if that works.

    Thread Starter Viktor Szépe

    (@szepeviktor)

    Yes. It works without shortcode unautop when “Move post content formatting (wp_autop) to after shortcodes” is turned on.
    The output is valid HTML.

    Thread Starter Viktor Szépe

    (@szepeviktor)

    Is this return do_shortcode( shortcode_unautop( trim( $content ) ) ); that does is all?

    Thread Starter Viktor Szépe

    (@szepeviktor)

    OK, I’ll add an option to turn on [block] shortcodes.

    Finally is [block] added?

    Thread Starter Viktor Szépe

    (@szepeviktor)

    To embed one into another it would be necessary to add block and block1..block9 also.

    Plugin Author Eliot Akira

    (@miyarakira)

    Hi Viktor,

    I finally included [block] shortcodes in a recent update. Wow, your original request was 7 months ago – sorry it took so long! One reason is, I wondered if there’s a common need for it. The plugin is constantly growing and I was afraid to include too many features.

    You can see in the documentation, I implemented it a little differently. The main difference is that nested blocks are written like this:

    [block]
      [-block]
        [--block]
          ...
        [/--block]
      [/-block]
    [/block]

    I also added all major HTML tags like div, article, section, span, as shortcodes. Not sure if that was such a good idea – but it’s there now!

    While working on this feature, I had an idea that these blocks can have extended functions, like responsive blocks. I’ll think about it – probably the best is to place hooks that can be used to add new functionality.

    Anyway, thank you for the suggestion!

    Thread Starter Viktor Szépe

    (@szepeviktor)

    Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘simple building blocks’ is closed to new replies.