Wondering if there’s something that will do the same thing in L&L?
I have tried the Format tag which works great but it still retains the trailing / which the php code removes. <Format replace="https://" with=""><Field website /></Format>
Hi there!
Unfortunately, there isn’t any possible way to do this but I will send a feature request to the devs and I’ll let you know when the feature is available!
Hi Tracey, we’re scoping out some more powerful regex-based format replace options so I’ll try to keep you posted here when those get released, but I’m not sure what the timeline is. I spoke to a dev and he mentioned that since you’re comparing the functionality you want to PHP_URL_HOST, that means that no slashes can be inside a host. I know on Facebook you mentioned that you “don’t want to replace the slash in case there are others in the URL” but it sounds like if there are other slashes in the URL then even PHP_URL_HOST wouldn’t work. I’m not familiar with PHP_URL_HOST myself but I figured I’d pass along my understanding of the insights the dev shared.
So all that to say, it sounds like you should be safe to remove all slashes with:
@TraceElement I just realized that it should actually be possible to remove the trailing slash in L&L even in instances where your URL includes other slashes. I was checking out the length attribute for the Format tag and I noticed it said this underneath:
Clicking on that link made me realize that this seems to accept negative numbers so I tried it and sure enough, if you use something like length=-5, it’ll chop off the last five characters. So in your case, you could probably do something like this if your URLs are always going to end in a slash: