SOLVED: Hooks in condition not working as it should with second or more conditions

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

I don’t know if it is a bug. I am testing HOOKS(v1.9.1) In conditions I have added the section template tp “bricks_after_header” and it works. The problem is I want to display on entire site but NOT frontpage. Adding a second condition has NO effect at all, it still shows on frontpage.

BUG or me?

3 Likes

Hi @AndreGroenewald,

Yup, you’re right. I was able to reproduce this locally and have added this to our internal bug tracker.

3 Likes

I have the same problem, extra conditions don’t work.

The other thing I noticed is, that the inserted template isn’t shown in the editor (like header and footer do), which might complicate designing the content.

Just an example: I’ve used the hook bricks_after_header to insert an additional section showing a page’s featured image, which should appear right after the main navigation placed in the header. Everything is fine on the front end, but when I open a page for editing, no featured image is shown, only the navigation. In this situation it’s quite hard to design the content of the page without seeing this importamt part of the design.

Before this feature was introduced, I tried to do the same using the code below, but the template didn’t show while editing either. Moreover, before the editor was fully loaded the template briefly flashed on the page, which didn’t look nice at all. At least this flashing is not happening when using the new feature. This is the code I used.

function bleye_add_image_header() {
    
    if ( is_front_page() ) {
        return;
    }

    echo do_shortcode( '[bricks_template id="265"]' );
}
add_action( 'bricks_after_header', 'bleye_add_image_header' );

@charaf , any plans on improving this feature in this direction?
Thanks

1 Like

Hi guys,

We’ve fixed this issue in Bricks 1.9.2 beta, now available as a manual download in your account (see changelog) and updated the Academy article: An Intro To Templates – Bricks Academy

Please let us know if you are still experiencing issues.

As with any beta release, please do not use it on any production/live website. It is only meant for testing in a local/staging environment.

1 Like

Hi @timmse,

Excellent, I can confirm it’s working now.

But the inserted template is still missing while editing the page where it should appear. As it is probably not a bug, but more of an feature request, should I create one for it? Or is something you are still planning to improve during the beta phase?

Thanks
Petr

Hi @Blackeye,

Yup please feel free to create a feature request for it :slight_smile:

Hi @charaf, just FYI

I was about to create a new feature request for the situation mentioned above, but I realized that the issue has been already discussed and it’s on the roadmap: WIP: Single Page template design isn't showing when editing a page

Hopefully it will be implemented soon

1 Like