Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
ReyDev Posted March 21, 2021 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/ ]
Solution Daniel F Posted March 21, 2021 Solution 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
ReyDev Posted March 21, 2021 Author 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
ReyDev Posted March 21, 2021 Author Posted March 21, 2021 In fact, what I want to do is get URL as it is.
ReyDev Posted March 21, 2021 Author 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.
Recommended Posts