Millie Moore Posted August 14, 2016 Share Posted August 14, 2016 well I attempted to do this <H1></H1> tag just like I did for another page. It worked for the other page but it didn't work on my contact-us.php page. I put both tags in shop/skins/mican/templates/main.php file. Here is what I have: {if $smarty.server.REQUEST_URI|stristr:'contact-us.php'} <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Contact Form</title> <H1>Contact Information and Form</H1> </head> </html> {/if} Can someone tell me what I did wrong and how to fix it? thanks Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2016 Share Posted August 14, 2016 Everything inside the <head> block is not rendered/displayed in a browser. The pattern is: <html> <head> head stuff like titles, CSS et al. </head> <body> <h1>Stuff seen in the browser</h1> </body> </html> Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted August 14, 2016 Author Share Posted August 14, 2016 I tried that and it still didn't show up: {if $smarty.server.REQUEST_URI|stristr:'contact-us.php'} <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Contact Form</title> </head> <body> <H1>Contact Information and Form</H1> </body> </html> {/if} am I still doing something wrong? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2016 Share Posted August 14, 2016 We can test if the test is failing... </body> </html> {else} Something went wrong. {/if} Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted August 14, 2016 Author Share Posted August 14, 2016 ok on https://mysite.com/shop/contact-us.html I got the message saying Something went wrong. Now what\? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2016 Share Posted August 14, 2016 Let's examine the test. {if $smarty.server.REQUEST_URI|stristr:'contact-us.php'} Generally, we testing for a result that is true-ish. That is, no explicit comparison. There is a danger to assuming this, however. $smarty is a valid variable name. And server is a good element name. And REQUEST_URI seems to be valid. So that leaves the value of $smarty.server.REQUEST_URI to be examined. Let's just assume it is "/store/contact-us.html".CubeCart 6 has friendly URLs that end in .html, not .php. So, test for that. Or, test for just "contact-us". The REQUEST_URI will return a leading slash followed by the path/document, so using stristr() to find 'contact-us.html ' should return something. Quote Link to comment Share on other sites More sharing options...
Millie Moore Posted August 14, 2016 Author Share Posted August 14, 2016 First I tried it with .html and checked /shop/contact-us,htnl and it showed the stuff I had in the <H1></H1> tag. Thanks! This is now resolved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.