Site logo

Archived topic

Custom Blocks? Different from Block Hook Elements?

5 replies · Started by Harry on December 29, 2021

Viewing posts 1–6 of 6

Hello GP Support Team!

I am looking to use custom blocks in my post layouts. These would be formatted blocks based on a paragraph block usually, for things like department, author, date, caption, reference, related article, and other things that appear throughout a post and are specific for that post. They don't have a fixed spot in a post to hook to in general. In my current non-wordpress site I format them with a div class="department" and then define them with CSS .department code. It's strictly a formatting tool, not a content tool.

I looked at Elements, which are a very cool tool for items that repeat in a specific spot in a group (or all) posts, like a note reminding people to subscribe that appears at the top of the footer, for example. But I could not see how to use block hook elements to format the author's name, for instance. But perhaps I don't understand how to use it! I looked at Genesis Custom Blocks, which seems more like what I'm looking to do. Does GP have something like this?

Thanks,
Harry

Hi Harry,

If you need to format the post's entry meta like date, categories, tags and author's name, you'll need to change the type of the Block Element to Block element - Post Meta Template as shown here - https://share.getcloudapp.com/geudZ8z4

Thanks, Elvin, that is certainly a good feature to know about. I'd also like to be able to create a custom block not related to the meta information. Perhaps a paragraph formatted differently that I would use occasionally, or for some other formatting purpose. Is there a general way in GeneratePress Pro to create custom blocks?

GeneratePress doesn't create custom blocks. :D

There may be a misconception w/ the Block element thinking it creates a custom block. It doesn't.

Block element is basically a page builder rather than a block builder. It doesn't create a block but it allows users to do layout from existing blocks and insert them anywhere. :D

But I guess, in a sense, you can create a "custom block" if you hook a Block element layout inside a portable hook placed on another container block but this technically isn't a custom block.

If you need a portable hook shortcode, you can try this one here - https://generatepress.com/forums/topic/hook-in-hook/#post-1636333

Thanks for explaining, Elvin. I think I'll need to use another plugin for creating custom blocks, as my grasp of php and shortcodes is slim at best.
Harry

Hi there,

for the non dynamic/meta content parts - you may just want to construct them using GenerateBlocks:

https://generateblocks.com

The Pro version allows you to save Global Styles and apply those to Local Templates. So you can simply insert your 'department' style template anywhere you require it and update its content for that post/page.

This archived topic is closed to new replies.