ninoP.3cube Posted May 7, 2014 Share Posted May 7, 2014 I need to get complete url page in .tpl file. I try many options but i can't get the whole URL, in particular, the url component after "index.php?". $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; get only http://www.xxx.it/index.php Link to comment Share on other sites More sharing options...
vekia Posted May 7, 2014 Share Posted May 7, 2014 and if you use code like: {$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI} what url you get then? Link to comment Share on other sites More sharing options...
ninoP.3cube Posted May 7, 2014 Author Share Posted May 7, 2014 (edited) http://www.abc.com/shop/index.php instead of http://www.abc.com/shop/index.php?controller=contact PS. this is an example url. Edited May 7, 2014 by ninoP.3cube (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 7, 2014 Share Posted May 7, 2014 strange in what file you're trying to include this code? contact.tpl ? Link to comment Share on other sites More sharing options...
ninoP.3cube Posted May 7, 2014 Author Share Posted May 7, 2014 (edited) I need hide the slider only in contact page. So, if url page contains "contact", hide it! i'm trying to include it in slider tpl file. Edited May 7, 2014 by ninoP.3cube (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 7, 2014 Share Posted May 7, 2014 use other if condition. {if $page_name!="contact"} display contents if page is not contact {/if} Link to comment Share on other sites More sharing options...
ninoP.3cube Posted May 7, 2014 Author Share Posted May 7, 2014 (edited) use other if condition. {if $page_name!="contact"} display contents if page is not contact {/if} i have already tried this option but the output is ALWAYS index, also in "index.php?controller=contact" page Edited May 7, 2014 by ninoP.3cube (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 7, 2014 Share Posted May 7, 2014 output? there is no output only if condition perhaps i or you missed something Link to comment Share on other sites More sharing options...
ninoP.3cube Posted May 7, 2014 Author Share Posted May 7, 2014 the problem is solved. I added this code in header.tpl <script> $(document).ready(function() { if(document.URL.indexOf("controller=contact")!=-1 || document.URL.indexOf("controller=order")!=-1){ $(".slider_container").hide(); } }); </script> Link to comment Share on other sites More sharing options...
Recommended Posts