Forum
Lang Session not passing variable on page load
I have used the second example in the multilingual site documentation. Everything appears correct as I have implemented this in other sites, but with this build the session is not being passed on page load. Can this be a Server config problem?
Ok appears to be fixed, all I changed was making sure all the pages are on the same level.
No it is not fixed. Anybody got any tips as to what could be causing the session to not be carried on load?
Can you show us what you're doing?
yes of course.
I am including the language session after perch at the top of the document.
Content is as documentation for second solution
Then I have page setting setup for page titles in eng/german
Here the english template
here are the diagnostics
Which is the part that isn't working?
it's actually all working. By page load it reverts back to 'de'. That is my worry. Why is the session variable not being passed.
From one page load to the next, or after the session expires?
Are you doing this before any HTML is output?
Yes, the session is being called right after the Perch call.
The Dev Site is Online actually: here
If you add this to the bottom of
language-session.php
what does it output?Hi Drew, other than breaking the layout it is writing the selected 'lang' in the top left hand corner.
I am using a master page which has this at the top:
Can you show me exactly what is output? The detail matters.
do mean with debug turned on....
Here is what I am getting in the front end:
I am also now getting this:
Ok I think I may have found the problem. I am using a layout footer with the following code:
The perch content is only being used for the links to other pages, in the back end, unlike all the other perch content it is only giving me one content field (content name -) not two (content name - de / content name -en).
Maybe I need to rethink how I am doing the footer layout...
Yes that appears to be it.
I have dropped the layout include, added a perch Content field and now all works as should.
Thank you Drew for prodding me in the right direction! Happy Monday to you!