Extract Page's URL Domain (including the Path) without the Parameters

Is it possible to extract a Page’s Domain with its Path minus the Parameters (or a specific parameter) after?

Here is what im trying to do: I have a “share” button under each post in a RG, clicking this button shows “Page’s URL” plus its post’s unique ID as a parameter, so when this link is shared, this specific entry will be visible to the User.

the Problem is that when following this link and trying to share it again, the link will include the path with the unique ID, plus the ID AGAIN, which sucks…

Then don’t do it that way. Construct the first part of the URL yourself (static text) and append the unique ID dynamically.

Like you just type the root part in and then insert the dynamic part.

There are other approaches of varying complexity of course, but this is the easy and quick way.

Its a recipe for disaster down the road, what if the current pages name changes? and what about development vs live? why cant i get an Operator : “Current pages URL” without parameters like the “Website URL” operator?

2 Likes

Only you would change it. Anyway, you could use regex to just crop to off the parts you don’t want or whatnot.

Anr way to think about your issue: IF the page’s thing is not empty, you want to add a thing to the shared URL. If it’s not, you do not want to re-add the thing. You can detect all of that. I’m not in front of a machine so can’t do it for you, but these ideas should get you started.

I could be mistaken, but I believe you can use current page domain (which returns either domain.com or domain.com/version-test), current page name, current page’s thing to construct the path:

current-pages-domain/current-page/current-pages-things-unique-id

1 Like

There isn’t such a thing but you can build it. “Is development version:formatted as text” return your domain for no and your domain with /version-test for yes.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.