Site logo

Archived topic

Button in Top-Header? Just on the German Pages Possible? (multi language Page)

6 replies · Started by Jenny on July 25, 2021

Viewing posts 1–7 of 7

Hello :)
Is there a possibility to get a button like this? But just on the German pages?
Maybe with the Element-Tool? Can you give me a push in the right setups?

That would be great.

https://ibb.co/grFfvBt

Hi there,

the site link you provided is behind a maintenance screen - can you disable that so i can take a look?

I am Sorry about :/ it's deactivated. 🙂

No problem :)

Tricky - takes a few steps.

1. You would use a Block Element ( or hook element ) to add your button.
1.1 Set the Hook to: generate_inside_secondary_navigation
2.2 Set the Display Rules to the Entire Site.

Before saving and exiting the Element, click on the URL in the browser and look for ID=xx make a not of the number xx

2. Then we need a PHP Function to tell it not to display on NON German pages:

add_filter( 'generate_element_display', function( $display, $element_id ) {
    if ( 99 === $element_id ) {
        if ( 'de_DE' !== get_locale() ) {
            return true;
        } else {
            return false;
        }
    }
}, 10, 2 );

In that code you would replace 99 with the Element ID

Hello David,

thank you :). Now I have got the button.
Is there a possibility to place just "Wunschtermin" the button on the right?

https://ibb.co/c2zJYHJ

🌻 thank you for your time

Ok - so couple of steps:

1. Add this CSS:

.dynamic-top-bar-container {
    flex: 1;
}
.gb-button-wrapper .gb-button.left-aligned {
    margin-right: auto;
}

2. Edit your Block Element:
select the Container Block, and in Advanced > Additional CSS Class(es) add: dynamic-top-bar-container
then select the individual button you want on the left, and give it a CSS Class of: left-aligned

Thank you David, 🙂
it worked on mobile very good, but mobile it was chaos 🙈
So I decided to delete one of the buttons an now it looks good even the button is on the right side.

Thank you for our help,
Jenny

This archived topic is closed to new replies.