Blocks with no fields?

Support MB Blocks Blocks with no fields?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #45880
    Topher DeRosiaTopher DeRosia
    Participant

    I want to make some blocks with no fields, so the data is hard coded. I'll return it with the callback

    The problem is that if I don't have at least one field with data, the attributes aren't populated and in the admin it says something like "not rendered" and on the front end I get nothing.

    How can I make a block with no fields?

    #45882
    Topher DeRosiaTopher DeRosia
    Participant

    Ok, I figured out how to render it, but I can still click the pencil and see nothing. Can I put in a placeholder there that says "You can't edit this block" ?

    #45886
    PeterPeter
    Moderator

    Hello Topher,

    There isn't an option to add the placeholder to the pencil icon. I think you can set the block position to the sidebar, the block settings will display in the sidebar without the pencil icon.

    #45896
    Topher DeRosiaTopher DeRosia
    Participant

    Actually, I'm talking about the box that appears when there's no content. It says "Block rendered as empty."

    #45903
    PeterPeter
    Moderator

    Hello,

    That is expected when there is no content to render, the text "Block rendered as empty." will be displayed. You should add some static content to the block template to replace the text.

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