[Support request] Home Header with Gutenberg Editor?

Home Forums Support Home Header with Gutenberg Editor?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1396679
    Nic

    Hi there,
    i installed recent WP and GP Premium themes/plugins and really like the default header block. But what i don’t like is that raw html code in there. No customer will understand this. Can i somehow enable gutenberg blocks here? i found out that i might use the new block type element but then the “site header” tab is missing! really need that. so what can you recommend please?

    View post on imgur.com

    #1396695
    Nic

    my workaround idea: keep both: home header type site header and one new block with gutenberg with no display rules. then embed that new block into the home header with a shortcode. this way customer only needs to edit the new block with gutenberg editor – yea!

    #1396722
    Nic

    only way it works for me now where ID is the one of the new block element with gutenberg:

    function db_hook_inside_shortcode($atts, $content = null) {
    	$header = get_post(18544);
    	$content = $header->post_content;
    	return $content;
    }
    add_shortcode('header_shortcode', 'db_hook_inside_shortcode');

    then i place the shortcode in the code editor of home header. what you think of it? this way i keep all header home capabilities and have the convenient edit possibilities one customer needs.

    #1396962
    David
    Staff
    Customer Support

    Hi there,

    currently the Block elements do not support template tags or have a featured image background. Both are on our list of updates. Starting with template tags in GPP 1.12 and featured backgrounds as soon as possible in GenerateBlocks.

    This will make it so dynamic elements can be created in the Block Editor. ( excited squeal here lol )

    In the meantime if you were NOT using template tags or replaced their output using shortcodes you could use the Block Element and hook this in position eg. after_header.

    For the Merged header option you can still create a Header Element, just don’t add any content to it and skip straight to Merge with Content on the Site header tab.

    Of course the Hook Shorcode is a ( rather bizarrely ) valid way of inserting Block content elsewhere – although i have not tested to see if the blocks dynamic CSS would get parsed…. and it feels really kinda hackish 🙂

    #1398279
    Nic

    In general i don’t feel good with the whole construction. I mean i have a home header to merge with the navigation. why do i need to edit it NOT in home page item? i have to edit it in another place (elements). this is far away from user intuitive. One customer will not understand this. Would be way better to have those page specific headers in the same edit place where the whole content is. you understand my desire/ expectations? i tend to insert a block in first place of a page. for instance “cover” with background image. then i would rather place a shortcode in header element only. in the shortcode i look for the first occurrence of cover item in the page and exclude it from regular content output but output it in header element to still keep the merging effects. this way it would be more user friendly but also hacky… what are your thoughts David?

    #1398735
    David
    Staff
    Customer Support

    If the ‘element’ is going to be page specific and the user needs the post editor to control its output then i would simply build it inside the post editor ( as you said ) and only apply a Header Element for setting a Merged site header / navigation.

    Scanning the post content for a specific block that you would want to remove from the post content and instead output in a Header Element is a possibility. But I am not sure the ramifications of doing so or where to begin with that … today.

    WP is working on theme editing within the block editor. This will allow multiple ‘content’ areas to be a thing and provide and deliver what you’re looking for. But we have yet to see how this will be rolled out to traditional themes and how we will develop into that.

    Today my personal approach is to use Custom Meta Boxes and Custom Fields to allow a user to select and update the dynamic displayed templates such as Header Elements. This way the user adds an image or text to the custom field and the element does the styling and layout.

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