Hi all,
I have someone else doing all the “standard” templating stuff, which leaves me with the funky bits.
Right now, I’m working on a multilingual SAEF. Language info is coming from a PHP session, which I initiate via a plugin: my_session. This works just fine.
However, inside the {exp:weblog:entry_form}, my plugin output is different from outside.
An example:
{exp:my_session:get_language_output}
{exp:weblog:entry_form weblog="my_weblog" return="site/index"}
{exp:my_session:get_language_output}
{/exp:weblog:entry_form}
The output:
English M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr
“English” is the correct output, of course. I’ve read the appropriate section of the user guide and searched the forums, but couldn’t find any reference.
Any clues? Assigning it to a variable and using that doesn’t work either.
TIA… Nico
Hi Robin,
The plugin just return()’s a string, in this case the string “English”. If I declare a variable like
{assign_variable:mylang="English"}
and use
{mylang}
outside and inside, the problem persists.
Perhaps the real problem is that I am trying to program the SAEF instead of designing it? (Please say no… 😉 )
Thanks!… Nico
Hi Lisa,
We’ve found that if the plugin output is only used inside the entry_form, it works allright.
Probably, I’m getting bitten by the order in which everything inside EE is handled. Since I want to use this output inside a conditional, I think building the SAEFs by hand is the only way to go for now.
As a PHP programmer, that would be a bummer.
Thanks… Nico
Hi,
Mark is right. It’s just a small plugin I am writing as the projects develops.
class My_session
{
var $language_values=array('en', 'nl');
var $language_output=array('English', 'Dutch');
function My_session()
{
if(empty($_SESSION['language'])){
session_name('session_name_here');
session_start();
$_SESSION['language'] = $this->language_values[0];
}
}
}
Up till now, it’s just a small bit of code that starts a session and assigns a language session variable (‘en’ by default). A few functions exist to set and retrieve the language variable.
Nothing perfect, nothing big. Yet. 😉
I am used to working with PHP sessions, which I why I chose this route.
HTH… Nico
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.