How to Create a Simple Toggle-Based Overlay Header in Bricks Builder

Поделиться
HTML-код
  • Опубликовано: 6 июн 2024
  • Overlay headers are very modern and visually appealing. Unfortunately, they make websites more difficult to manage because they require special design considerations and potentially limit what you can do with hero sections.
    BUT ... what if we could selectively apply an overlay header style to a given page while retaining a standard header on all other pages by default? That would be very powerful!
    AND ... what if we could choose between an overlay header and a traditional header without having to manage two separate headers? That would be way better!
    That's exactly what I'm going to show you how to do in this tutorial. And you'll learn some other great stuff along the way, like using and styling data attributes, Metabox custom fields, Bricks dynamic data, Bricks conditions, and more.
    If you love content like this, then you'll definitely want to check out my Inner Circle: digitalambition.co/inner-circle/
    If you want the best way to manage custom CSS and even write SCSS for your builds, get WPCodeBox: geni.us/uu8jqqf
    00:00 Intro
    00:46 Example
    05:10 Getting Header Template Ready
    06:46 Creating a Toggle With Metabox Custom Fields
    09:50 Data Attributes
    14:30 Styling the Data Attribute
    20:44 Swapping the Logo
    26:40 Wrap-Up

Комментарии • 149

  • @JubranZakri
    @JubranZakri Месяц назад

    Kevin, I am extremely grateful for your fantastic tutorials.

  • @interculturalcommunication3889
    @interculturalcommunication3889 Месяц назад

    Shared this video with my intern today. One year later this video is still pure gold.

  • @markpeters2254
    @markpeters2254 Год назад +1

    I can't stop watching these vids. No nuggets here, it is a freaking gold mine

  • @simonkerridge
    @simonkerridge Год назад +2

    Brilliant! As a Brit known for understatement, I don't say that lightly. Learning so much since I discovered your videos. Thank you. 🙂

  • @FernandoArbex
    @FernandoArbex Год назад +10

    Man, your tutorials are pure gold.
    Thank you a lot.

  • @reufjaha123
    @reufjaha123 2 месяца назад +1

    Amazing tutorial Kevin, before I was creating multiple headers lol.

  • @jerrycompanjen5325
    @jerrycompanjen5325 Год назад

    These are great! Please do more, love learning from you!

  • @glennrabbypaulin1853
    @glennrabbypaulin1853 Год назад

    I always love your tutorials. Keep posting please.

  • @penatechnologies492
    @penatechnologies492 Год назад

    Love your stuff man. Grateful that you have a passion for teaching as well!

  • @silentphil77
    @silentphil77 Год назад +2

    Awesome! lots of gold in here thanks Kevin

  • @RMSAnalyst
    @RMSAnalyst Год назад

    Brilliant tutorial Kevin, as always! ❤

  • @sumerianbrother
    @sumerianbrother Год назад

    TY Once Again! Nuggets all over the place! Cheers!

  • @digwillhachi
    @digwillhachi Год назад

    I always learn something from every video you put out. Amazing content!

  • @isaurasotoca
    @isaurasotoca Год назад +2

    Really interesting! Getting rid of duplicate headers from now on 😊 Thanks Kevin!

  • @kareem2928
    @kareem2928 Год назад +2

    Thank You! ^__^ Diamond. You literally translated our needs,, requests, thoughts to become a true event. Much appreciated.

  • @ocbroadband
    @ocbroadband Год назад

    Always great stuff. I shake my head everytime I see new stuff like this and my head just explodes with things I start thinking I can now potentially do.

  • @osvaldoodon
    @osvaldoodon Год назад

    Thanks for such a great video 👏👏👏👏. Was exactly what I was looking for

  • @steveclark4821
    @steveclark4821 Год назад

    Great tutorial, as always. Learn something new with every single video!

  • @johnanoh6099
    @johnanoh6099 Год назад

    Wonderful! out-of-the-box-thinking solution to the double header dilema. Thank you!

  • @morozara4962
    @morozara4962 7 месяцев назад

    Awesome! I am actually learning.

  • @alexanderbeutl
    @alexanderbeutl Год назад

    This Tutorial is awesome 🙌
    Immediately impemented it on my page, since I also use an overlay header

  • @fredchams1052
    @fredchams1052 Год назад

    Brilliant and effective as usual 🤩

  • @bramvandinteren
    @bramvandinteren Год назад

    Glad you point out that custom field glitch at 23:00 , been having troubles with that in the past aswell. Great video as usual!

  • @stripedgoat8470
    @stripedgoat8470 Год назад

    That's a neat way! Thanks for sharing!

  • @brianholt6083
    @brianholt6083 4 месяца назад

    Another Awesome Tutorial...

  • @melissademayo7141
    @melissademayo7141 3 месяца назад

    So cool! Learned something new!

  • @VinceBalk
    @VinceBalk Год назад +1

    GOAT! Man I love your tutorials. Thanks for sharing so much knowledge with us Kevin!

  • @ElementoryMyDearWatson
    @ElementoryMyDearWatson 9 месяцев назад +1

    Your channel is an utter goldmine for learning and advancement. Thank you so much for your generosityand passion.

    • @Gearyco
      @Gearyco  9 месяцев назад +2

      My pleasure!

  • @HayleyHagen
    @HayleyHagen Год назад

    Wow...learn something new every time I watch your videos. Thank you for sharing your knowledge 🙂

    • @Gearyco
      @Gearyco  Год назад

      Happy to hear that!

  • @PicSta
    @PicSta Год назад

    Great tutorial. Thanks for that. :)

  • @jugibur2117
    @jugibur2117 Год назад

    I am not currently a Bricks user and was curious to see what could be done with it. What you showed was really fascinating and gave me a good insight, thanks for your effort!

    • @Gearyco
      @Gearyco  Год назад

      Glad you enjoyed it!

  • @davidwalls2304
    @davidwalls2304 Год назад +1

    Kevin, I'm really not sure where to start. This video was PURE GOLD! I've never thought of using toggles, logic, and SCSS styles like this EVER. I watched this video 2x just to make sure I didn't miss anything and I'll probably watch it a few more times in the future when I'm developing future sites.

    • @Gearyco
      @Gearyco  Год назад

      Glad you liked it!

  • @ReubenHochstetler
    @ReubenHochstetler Год назад

    Great tutorial.

  • @bluefuzecom
    @bluefuzecom Год назад

    Love this!

  • @AmandaLucaseu
    @AmandaLucaseu Год назад +1

    Love the video Kevin - upping my chump free game one tut at a time 😂

  • @wpeasy
    @wpeasy Год назад

    Typically and beautifully simple :)
    I still use Elementor with JetEngine for sites my clients will edit (I know one of your least favorites)..
    I just checked to see if I can do the same thing and you can.
    Basically with the Attribute,
    - you select JetEngine->Custom Field
    - set the "Before" to "data-overlay-header|"
    - set the fallback to "data-overlay-header|Standard"
    I do love the Bricks way of handling Dynamic Data, but in this case it works :)

  • @edanbenatar
    @edanbenatar 3 месяца назад

    Knowledge bomb! 🔥

  • @azuzaazuza
    @azuzaazuza Год назад

    Gold indeed!

  • @danstevens1974
    @danstevens1974 2 месяца назад

    just found this - a great help. I did have to use !Important; in my CSS in some cases, but i'm assuming that is fine and normal!

    • @Gearyco
      @Gearyco  2 месяца назад

      Hmm, shouldn’t be necessary

    • @danstevens1974
      @danstevens1974 2 месяца назад

      I could well be doing something silly! I'm using Appearance > Theme file editor > Bricks Child Theme: Stylesheet (style.css). Not idea if that's relevant or not.@@Gearyco

  • @BGdev305
    @BGdev305 Год назад

    good one

  • @Atz22
    @Atz22 Год назад

    Hey Kevin - nice video and interesting approach to teach a different method but I think for this specific use case using bricks I think it's easier and better to have different header templates for the home page and another for other pages..will give you much finer control but as a general technique video it's very good 🙏😎

    • @Gearyco
      @Gearyco  Год назад +1

      How will that give you finer control? You’ll have duplicate elements to manage, including duplicate menus.

  • @korduran
    @korduran Год назад +1

    Another great "chump-free" tutorial.

  • @pandaosa9
    @pandaosa9 Год назад

    Magic!!

  • @YorgoKastri
    @YorgoKastri Год назад

    thank you!

  • @jzajzz
    @jzajzz 6 месяцев назад

    27:55 sounds like a former Google engineer on the RUclips team 😂

  • @HamedHaidari
    @HamedHaidari 4 месяца назад

    Great compliments Kevin. Your videos and explanations are truly amazing. I have one question, if I set Toggle-based Overlay header, and at the same time I have sticky header. Can I set condition to the Sticky header to switch to "standard format?
    Thanks

    • @Gearyco
      @Gearyco  3 месяца назад

      Not sure I understand the use case.

  • @daviddemastus
    @daviddemastus Год назад

    Thanks for this! Super helpful.
    If I were to create 2 different hero style options with the same type of toggle, would I create 2 different hero sections in my Page template and use conditional logic to show/hide the hero section? Or should I use the same data attribute method? I'm not sure it would be efficient to use custom css for a hero section, especially since I can just use Bricks to natively style it.

    • @Gearyco
      @Gearyco  Год назад +1

      Two different heroes and use conditional logic.

  • @geokongr
    @geokongr Год назад

    Great video! Do you recommend using filter css property on logo as well, instead of conditions? E.g. .logo img { filter: brightness(0) invert(1); } on Overlay.

    • @Gearyco
      @Gearyco  Год назад +1

      No. You would never want to invert a company's brand colors. The logo really needs to be swapped to a different file. It just so happened that my example used a pure black logo, but most logos aren't like that.

  • @chg121
    @chg121 Год назад

    Thank you, great stuff! How would you handle customization for site wide styling. With Settings-Page from MetaBox?

    • @Gearyco
      @Gearyco  Год назад

      I’d need more of an example of what you’re wanting to do.

    • @chg121
      @chg121 Год назад

      @@Gearyco It's about the website for a theater project. Every year there are two phases. Phase 1 is about attracting new participants. Afterwards, when the participants have prepared a new play, it is about selling tickets for the performances (phase 2).
      My idea is to switch between these modes via a global setting, so that e.g. on the home page individual sections (buy tickets, registration form etc.) are shown or hidden. Is this a realistic approach?

  • @awayougo
    @awayougo Год назад +1

    Lovely contetn Kevin!! I would like to give it a go as well since I have got Bricks. Just a question can I use Metabox(free version) to achieve the same result?
    Cheers for sharing pal! :D

    • @Gearyco
      @Gearyco  Год назад +2

      Yep, you don’t need the paid version!

  • @knuterockknee
    @knuterockknee Год назад

    Can you add the ACF overlay setting to a bricks template

  • @kappesante
    @kappesante Год назад

    i, as always, like

  • @iservisat
    @iservisat 4 месяца назад

    Great tuto as always Kevin. My question is: How can use this method if I need to use the overlay in Terms archive pages?

    • @Gearyco
      @Gearyco  4 месяца назад

      Does it not work?

    • @DaleDonnolly
      @DaleDonnolly 2 месяца назад

      @@Gearyco No it does not work for CPT Archive Templates

  • @SridharKatakam
    @SridharKatakam 5 месяцев назад +1

    Using 2 separate headers and making one be output depending on the value of a custom field is a perfectly scalable and maintainable method imo. We are, after all, using the same nav menu.

    • @Gearyco
      @Gearyco  5 месяцев назад

      Sure, it’s just harder to manage imo and creates more opportunities for inconsistencies (eg update one and forget to update the other).

    • @SridharKatakam
      @SridharKatakam 5 месяцев назад

      There is nothing to update in the other overlay header once it is set up. The light version of the logo is not something that typically changes, and neither are the nav menu items because they come from the same WP menu the regular version of the header also uses.

    • @Gearyco
      @Gearyco  5 месяцев назад

      That's not always true. Lots of people are using the Bricks mega menu system which doesn't use the WP menu system at all. Of course, you could make that its own template and insert it with a template part, but then you have template inception which is always annoying when you go to edit the header. And depending on design, the header could have a lot more information. Phone numbers, addresses, secondary links, sale banners etc. I'm not saying the way I showed is the only way to do it, but it's a simple and elegant solution that cuts out a lot of potential hassle.@@SridharKatakam

  • @eLeieZer
    @eLeieZer Год назад

    Great content Kevin as always! I am considering changing to Brick from Oxygen, do you think it is worth it?

    • @Gearyco
      @Gearyco  Год назад

      Yes I definitely recommend switching.

  • @winwinis3483
    @winwinis3483 Год назад +1

    Kevin, I am interested in why don't you like sticky header? For me, as a user, it saves me having to scroll all the way to the top every time I want to check a new page, especially if no "back to top" link available.
    Have you done / could you do a tutorial on multiple row Sticky Headers in Bricks with reducing the size of the logo and just 1 row to minimize space on scroll?
    BTW I love all your tutorials.

    • @Gearyco
      @Gearyco  Год назад +2

      Beacuse it takes me 00000.01 seconds to scroll to the top of a site. It's a flick of the mouse. Sticky headers always feel in the way when I'm trying to read content on the page. Even when they shrink down, I don't like that they're taking up real estate.

    • @benzmediaservices
      @benzmediaservices Год назад +1

      Hey​@@Gearyco
      What do you think about "hide / show on scroll navigations"?

  • @richardpeirce490
    @richardpeirce490 Год назад

    nice option, thanks. My only question: why not simply change the svg color based on the data attribute?

    • @Gearyco
      @Gearyco  Год назад

      A lot more work when you have multi-color logos. And in the case of the client I showed for an example, it's a complex gradient.

  • @superoverdrive8628
    @superoverdrive8628 Год назад

    26:48 - Have been looking for a solution to automatic extra spacing but I haven't found a solution yet. Is that something you have posted or can post? 😀

  • @julianmoreno6925
    @julianmoreno6925 7 месяцев назад

    The wizard of web design, thank you very much for sharing man

    • @Gearyco
      @Gearyco  7 месяцев назад

      My pleasure!

  • @TheLiveTentation
    @TheLiveTentation Год назад

    Great content Kevin!
    Wouldn't it be easier/better to replace the logo file straight in CodeBox in the data-header-style="Overlay" attribute? This way you have everything in one place and you get rid of conditions in Bricks.
    *If you want to cover a link, do the bottom-left part of the screen too (SubCaptioner example section) 😀

    • @Gearyco
      @Gearyco  Год назад +1

      With php?

    • @TheLiveTentation
      @TheLiveTentation Год назад

      @@Gearyco I don't think we need php. CSS content property should do it.

    • @Gearyco
      @Gearyco  Год назад +1

      @@TheLiveTentation You can't put info like that in content field of CSS because it's not crawlable.

  • @toby-green
    @toby-green 6 месяцев назад

    A tidy solution. I use ACF and it has the same issue with newly created fields not applying defaults until the content is saved. I guess this is a WP issue. Imagine there is some SQL that would apply the update... Did you ever get around to the tutorial on subtracting header height from 100vh? I did this in Bricks using Calc and subtracting header height variable and it's about 10 to 20px off.

    • @Gearyco
      @Gearyco  5 месяцев назад

      Yes, because the save is what commits that data to the database.

  • @thorsten-roever
    @thorsten-roever Год назад

    Thanks for the great tutorial.
    However, I didn't understand why I should set the color of the links to black in the css and then invert them to white. What's wrong with setting it to white right away?

    • @Gearyco
      @Gearyco  Год назад

      On some menus that’s fine. On certain menus Invert is more efficient. But I said in the video you can do it either way.

  • @filmgenius2
    @filmgenius2 10 месяцев назад

    What if the header overlaps with the Hero’s container, how would you calculate it to add extra spacing between the header and Hero’s container?

    • @Gearyco
      @Gearyco  10 месяцев назад

      ACSS does this automatically. But there are a few methods. It’s hard to explain in RUclips comments.

  • @anaf4072
    @anaf4072 Год назад

    Thanks Kevin! Why did you not just set color: #fff for overlay header? You went with color:black and then filter.. Why?

    • @Gearyco
      @Gearyco  Год назад +2

      For a super simple menu like this you can do that. For more complex menus it’s often more efficient to use invert. But like I said in the video there are multiple ways to accomplish the same thing.

  • @dahunsi
    @dahunsi 2 месяца назад

    Pardon me if this question has been asked, but will the automatic header offsets in ACSS work with this method of creating overlay headers?

    • @Gearyco
      @Gearyco  2 месяца назад

      Yes

    • @dahunsi
      @dahunsi 2 месяца назад

      Good to know. Got some laying around to do.

  • @sjchalton
    @sjchalton 5 месяцев назад

    Should this still work if a background-color is applied to the 'Standard' header. For some reason [data-header-style="Overlay"] .fr-header-alpha {background-color: transparent;} doesn't have an effect.

    • @Gearyco
      @Gearyco  5 месяцев назад

      I’d have to see a link.

  • @Multilive1000
    @Multilive1000 Год назад

    Is it also possible to make 2 headers in the header template and show/hide them with conditions?

    • @Gearyco
      @Gearyco  Год назад

      Yes but I explained why this isn’t desirable in the video.

  • @user-nd3sc8ir1b
    @user-nd3sc8ir1b 6 месяцев назад

    Is it possible to use attributes with gradient overlays?
    I want to create a query loop using the ACF repeater field.
    Inside the ACF repeater I want to add a main gradient color. The other color will be transparent.
    I want to be able to set the gradient using a dropdown.
    I've created data-bg-color, but I'm not sure how to apply it to the gradient.

    • @Gearyco
      @Gearyco  6 месяцев назад

      Yes definitely possible

    • @user-nd3sc8ir1b
      @user-nd3sc8ir1b 6 месяцев назад

      @@Gearyco Can you create a tutorial for it? ;)

  • @TammyButcherPlus
    @TammyButcherPlus Год назад

    For some reason, I can't get my page to accept the data-header-style. I'm selecting the element correctly via script (I can change the color using the same selection in the Inspector). And the radio is created as I can select Overlay when I edit a page. Yet it does not seem to select it dynamically so I can style it via script. Any thoughts on this?

    • @Gearyco
      @Gearyco  Год назад

      Could be a lot of things. Without a link, there’s not much I can do.

  • @sauna-bauer
    @sauna-bauer Месяц назад

    Hey Kevin. Is this still best practice or is ther an "easier" solution nowadays?

    • @Gearyco
      @Gearyco  Месяц назад +1

      As far as I know but I don’t have a need for this very often

  • @AnthonyTilahun
    @AnthonyTilahun 2 месяца назад

    There's an issue using this method when it comes to the mobile menu. It causes a conflict of displaying the mobile menu properly, @Gearyco, I noticed you never clicked on the mobile menu to see how this affects the color of the mobile menu? I've tried targeting the mobile menu only and setting the filter:none, but one will always override the other regardless of the specificity, unless I'm doing this wrong. Has anyone else tried to look at their mobile menu while implementing something like this?

    • @Gearyco
      @Gearyco  2 месяца назад

      This doesn’t create any issues with mobile

  • @natandomnik
    @natandomnik 10 месяцев назад

    question is how can I set the header color in the template? When I give conditions for the archive to retrieve the value from the radio selection, the value is not retrieved.

    • @natandomnik
      @natandomnik 10 месяцев назад

      SOLVED: ok I set the attribute after the content loads, which is called by the class that appears in the archive template

    • @DaleDonnolly
      @DaleDonnolly 2 месяца назад

      @@natandomnik Do you mind sharing how you achieved this? Did you use Javascript?

  • @JanTejano
    @JanTejano 4 месяца назад

    Can I still work on, even I don't have metabox?

  • @BrianBAndersen
    @BrianBAndersen Год назад

    Great video and technic. :D
    But i wonder, how do you create the data attribute and condition on a template page ?
    Lets say, you create a template for CPT "services" archive and singular page, and you want the menu to be blue on that specific pages, how do you target the template, as its not a page and the Radio created for standard and overlay is not working on templates..

    • @Gearyco
      @Gearyco  Год назад +2

      Different technique. I’ll do a video

    • @BrianBAndersen
      @BrianBAndersen Год назад

      @@Gearyco Are you still working on this or should I look in the inner circle forum for the video? :-)

    • @vault1508
      @vault1508 8 месяцев назад +1

      @@Gearyco ​ @BrianAndersen78 Is there a video of this yet? This technique is great but the end user has to toggle for every new post they do. It would be great, if I could just use the correct toggle setting on my posts template, so it automatically works on all posts. I tried doing this and it doesn't work.

  • @breakused
    @breakused Год назад

    good video, but the question is, if the user scrolls down and hits a white section, what then? i understand that you can solve this with code, but how do we solve this problem specifically with bricks? i mean, what if we do make a sticky header? :)

    • @Gearyco
      @Gearyco  Год назад

      Shouldn’t be an issue

  • @PeterEller
    @PeterEller Год назад

    metabox is not tested with the latest version of WP is there a way to do this manually without using the metabox plugin

    • @Gearyco
      @Gearyco  Год назад

      ? Plugins don’t release updates instantly. It works fine. It’ll update soon.

    • @PeterEller
      @PeterEller Год назад

      @@Gearyco cheers! your videos are excellent!!

  • @sophiemulders
    @sophiemulders 6 месяцев назад

    love this solution, try to build it with pods... but nope pods wont let me do it, damn need to buy AFC of metabox lol.

    • @Gearyco
      @Gearyco  6 месяцев назад

      What was missing in pods?

    • @sophiemulders
      @sophiemulders 6 месяцев назад

      @@Gearyco In pods you can add CPT but not seperate custom fields. The custom fields are part of the CPT you make. But you can extend an existing post type. so I extended 'pages' added the radio buttons, but i cant get the value of those radio buttons in my data attribute in bricks.
      so maybe i am thinking to difficult but after trying for an hour and researching to get the data .. i gave up. for now.
      and probably it gives a problem for custom post types, but did not have a chance to test. I cant appoint them to pages and posts, unless i also extend posts to but then i am repeating myself and that is chump like behaviour and someone told me not to do that ;)

  • @Thephonkgod
    @Thephonkgod Месяц назад +1

    Amazing tutorial! However, i just hate the fact they made it so complicated.

  • @nathansimpson6934
    @nathansimpson6934 11 месяцев назад

    sounds like the header with overlay is the exception and thus just create a header for home. then default header would be remaining...
    Why not? you can place global module or columns inside header and thus manage 1x with as many header rows or backgrounds as you like...

  • @marciobttb
    @marciobttb 2 месяца назад

    I read that you no longer use this but instead use a taxonomy?

    • @Gearyco
      @Gearyco  2 месяца назад

      correct

    • @marciobttb
      @marciobttb 2 месяца назад

      @@Gearyco How do you do it? Simply create a custom taxonomy with the two options we need and then style with CSS just like before? Do you add the taxonomy as a class in the header wrapper?

  • @NOALNOM
    @NOALNOM Год назад

    Can you explain how to use or integrate AOS data attributes, and data-swiper-parallax attributes in Bricks? A serie of videos explaining how load barba.js in Bricks also will be like a dream come true, Thanks Kev, can't wait to tomorrow's Table Talk 003 ruclips.net/video/CWiVpovGN5c/видео.html

  • @jeffbarnhart6441
    @jeffbarnhart6441 5 дней назад

    f it, godd*mnit. I'm going to get bricks. lol.

  • @Anderson-bk1hf
    @Anderson-bk1hf Год назад

    You make everything so complicated.

    • @Gearyco
      @Gearyco  Год назад

      How would you accomplish this?

    • @Anderson-bk1hf
      @Anderson-bk1hf Год назад

      @@Gearyco Alchemy obviously

    • @Gearyco
      @Gearyco  Год назад

      @@Anderson-bk1hf do you have anything of value to offer?

    • @Anderson-bk1hf
      @Anderson-bk1hf Год назад

      @@GearycoJust a few gold coins and a railroad bond.

    • @Gearyco
      @Gearyco  Год назад +3

      @@Anderson-bk1hf okay, have fun playing with yourself.