Soma Posted April 15, 2013 Posted April 15, 2013 I use alternative filename on template to use main.php, from where I render the content according to the template name. So basic-page would result in including the /views/basic-page.inc in the main.php I now use latest PW on this new site and it doesn't work anymore, as all those end up having a template name "home". When I echo the $page->template it shows "home" no matter what template. I changed things around and when I use it without alternative filename it works as usual. Can somebody confirm this?
diogo Posted April 15, 2013 Posted April 15, 2013 Just tested this on a new 2.3 install and everything worked normally. Just in case I didn't understand what you mean, this is what I did: went to basic-page template and changed "alternate template filename" to sitemap. Now I have a sitemap in all pages. 1
Soma Posted April 15, 2013 Author Posted April 15, 2013 Thanks diogo, yeah somehow, I just have a main.php and in there echo $page->template outputs "home" always. It's all very confusing and I can try what I want but no success. It works in other installs though. I copied this site from one that is very similar and used same template approach. So as a start I copied db and site folder, and dropped in lates wire core. I'm still trying find what's wrong, but I'm kinda lost.
Soma Posted April 15, 2013 Author Posted April 15, 2013 Ok once again I have beaten myself... after trying to find a reason, nothing worked I thought it just can't be and knew there must be something stupid like $page->template = "home" in the code... and gotcha! I really should be more careful and always use "home" == $page->template Thanks diogo for your time. 2
arjen Posted April 16, 2013 Posted April 16, 2013 What's the difference between "home" == $page->template and $page->template == "home"?
diogo Posted April 16, 2013 Posted April 16, 2013 It's good practice because if you make a mistake and write "=" instead of "==", the first one will give you an error and the second will mess everything by assigning "home" to $page->template without giving any warning. 4
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now