CMS Development

SDEGLIAME
Participant

Detect anchor in url with hubl

SOLVE

Hello folks, 

 

For a dynamic page I need to know if an anchor is used in the url.

I know how to manage this kind of stuff with JS but in this case it's I have to modify the request I made to construct the page so, I think it must be done with hubl, but I don't find any solution yet.

Did I'm wrong ?  

I saw that the variable request can give me some informations but not the anchor.

Has anyone come across a similar case?

0 Upvotes
1 Accepted solution
AddaxLab
Solution
Member

Detect anchor in url with hubl

SOLVE

The request object in HubL provides information about the query parameters, but it does not include the anchor part, as this is not transmitted to the server during the request.
Since the anchor is not available server-side, the only reliable way to handle this is with JavaScript. You would need to check for the presence of the anchor on the client side after the page loads and modify the page's content or behavior based on that.

AddaxLab_0-1726152215291.png

 

 

View solution in original post

0 Upvotes
2 Replies 2
SDEGLIAME
Participant

Detect anchor in url with hubl

SOLVE

Thanks for your response !

0 Upvotes
AddaxLab
Solution
Member

Detect anchor in url with hubl

SOLVE

The request object in HubL provides information about the query parameters, but it does not include the anchor part, as this is not transmitted to the server during the request.
Since the anchor is not available server-side, the only reliable way to handle this is with JavaScript. You would need to check for the presence of the anchor on the client side after the page loads and modify the page's content or behavior based on that.

AddaxLab_0-1726152215291.png

 

 

0 Upvotes