SOLVED: How to make an anchor link?

Looking at your screenshot that behavior is very weird. Never happened to me, perhaps you added a # inside of the CSS ID section?

I have just tested this again on a new page without any prior anchor links and it works properly for me on v1.2.

Here is another Loom of how I did it:

6 Likes

You perfectly right i messed wiih a custom html tag. Now it works perfectly. Thanks!

1 Like

@cristianuibar Thank you so much for jumping in on this one. Rockstar :muscle:

2 Likes

hi there, another question regarding this topic: is it possible to link to an anchor link on a different page as well?

Sure. It should be the same process. Just use the full url instead of just the #anchor

1 Like

works great, thank you so much for the quick answer!

1 Like

I’m also happy, i was just searching for “how to anchor” and this video was quit and easy =). now i know how to do it, thank you very much =)

2 Likes

Thank you so much Cristian!
I was looking for this a few moments before and your video and instructions are spot-on!
Great community and thank you once again!
Fellow Romanian bricks enthusiast

Hi there,

What about anchors inside elements on a loop?

Is it possible?

Thank you!

Hi @chrisianuibar and thanks for your help here! Is that workaround still needed with the specific url? Because as far as I know, absolute links are bad practice and should be avoided (see end of this site: HTML File Paths). If the domain or the URL changes, I would have to change every single button that links to it… Thought that’s why there is the “internal post” option in the dropdown.

Edit: Okey I just saw that relative paths are allowed here too. Still questioning myself why this is not integrated in the “internal post” option. Or have I overseen something here?

1 Like

Hello @901422183 ,

I don’t think that matters that much. WordPress saves the full permalinks in a GUID field in the DB anyway. So if you ever change your primary domain, you’ll always need to run a full search-replace for the old domain to the new domain. And this search-replace should also fix any such links you have on your buttons.

Also, the “internal post” generates a full URL on the front, as that’s WordPress’s default behavior. It just generates it on the fly.

1 Like

Hi @cristianuibar and thanks for your fast answer! :slight_smile:

I am new to WordPress so thanks for that explanation! In case of an Domain change I understand what you mean, but what if I change the slug of the page I linked to? When done with bricks page selection that would not change anything. When done with a relative/absolute link I would have to change that on each buttons instance… or have I misunderstood something here?

You are correct. For that use-case it’s better to use internal links, as absolute links will not auto-update.

The best rule is to avoid changing slugs once your page is published. It can be shared on other pages/social media etc and you might end up with a 404 for that. However even in that case, if you’re changing a popular page link you should add a 301 redirect for it.

1 Like

Thanks for your help! :slight_smile:

Oh I forgot: How you did the smooth scroll to the anchor in your video?

I know there are multiple ways, but I am interested in yours, that seems to work pretty well with Bricks :slight_smile:

I didn’t do anything else other then what’s in the video.

I guess Bricks has that? Not sure about it :thinking:

I meant, that it scrolled to the anchor instead of jumping. There are css and js ways to do it, maybe it was a preset in an external template. Thanks for your answer :).

Smooth scrolling is available natively in Bricks. What you need to do is just to make it scroll to your section within the same page.

Hm okey, I may need to try it again. Last time it did not scroll smooth. Is there a setting I need to activate first?

Thanks for your help :slight_smile:

Hi, smooth scrolling is not working for us. We tried the native ID given to the section (Div), and also tried applying a custom ID via CSS ID field; but in both cases it jumps to the section on click, rather than scroll.