ReyDev Posted March 21, 2021 Share Posted March 21, 2021 I get current URL with this: \IPS\Request::i()->url() sometimes it returns : http://ips.valacoding.com/index.php?/store/product/2-the-compound-effect/ and sometimes returns : http://ips.valacoding.com/index.php?app=core&module=system&controller=widgets&do=getBlock&blockID=app_nexus_latestProducts_tfxsn9iaq&pageApp=nexus&pageModule=store&pageController=product&pageArea=header&orientation=horizontal..... Is there a specific method that always returns URL in friendly form? [ http://ips.valacoding.com/index.php?/store/product/2-the-compound-effect/ ] Link to comment Share on other sites More sharing options...
Solution Daniel F Posted March 21, 2021 Solution Share Posted March 21, 2021 Why would you want to get a friendly url for http://ips.valacoding.com/index.php?app=core&module=system&controller=widgets&do=getBlock&blockID=app_nexus_latestProducts_tfxsn9iaq&pageApp=nexus&pageModule=store&pageController=product&pageArea=header&orientation=horizontal..... ? The page is meant to be shown in a modal and only to moderators with permissions to edit the sidebar, there's no point in having a friendly url here. ReyDev 1 Link to comment Share on other sites More sharing options...
ReyDev Posted March 21, 2021 Author Share Posted March 21, 2021 (edited) 8 minutes ago, Daniel F said: Why would you want to get a friendly url for http://ips.valacoding.com/index.php?app=core&module=system&controller=widgets&do=getBlock&blockID=app_nexus_latestProducts_tfxsn9iaq&pageApp=nexus&pageModule=store&pageController=product&pageArea=header&orientation=horizontal..... ? The page is meant to be shown in a modal and only to moderators with permissions to edit the sidebar, there's no point in having a friendly url here. This is what is returned with this helper: \IPS\Request::i()->url() When I'm here http://ips.valacoding.com/index.php?/store/product/2-the-compound-effect/ Edited March 21, 2021 by ReyDev Link to comment Share on other sites More sharing options...
ReyDev Posted March 21, 2021 Author Share Posted March 21, 2021 In fact, what I want to do is get URL as it is. Link to comment Share on other sites More sharing options...
ReyDev Posted March 21, 2021 Author Share Posted March 21, 2021 2 hours ago, Daniel F said: The page is meant to be shown in a modal and only to moderators with permissions to edit the sidebar, there's no point in having a friendly url here. Thanks. This point was very useful and I realized where the problem came from. Link to comment Share on other sites More sharing options...
Recommended Posts