We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SAEF - output from plugin changes inside {exp:weblog:entry_form}

Development and Programming

nanook's avatar
nanook
23 posts
17 years ago
nanook's avatar nanook

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

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
17 years ago
Robin Sowell's avatar Robin Sowell

It kind of looks like a placeholder, but I’m not sure why. If you hard code it, it comes out fine- correct? What’s the plugin doing?

       
nanook's avatar
nanook
23 posts
17 years ago
nanook's avatar nanook

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

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
17 years ago
Lisa Wess's avatar Lisa Wess

Hi, Nico - Can you confirm that the Stand Alone Entry form works, if you copy and paste the example from the docs?

       
nanook's avatar
nanook
23 posts
17 years ago
nanook's avatar nanook

Hi Lisa,

Yes, I can. I am actually building my SAEF with code snippets from that example.

Thanks… Nico

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
17 years ago
Lisa Wess's avatar Lisa Wess

Hi, Nico - since the SAEF itself works, I’m going to shift this down to the Plugins forum to get more focused assistance for you.

       
nanook's avatar
nanook
23 posts
17 years ago
nanook's avatar nanook

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

       
Laisvunas's avatar
Laisvunas
879 posts
17 years ago
Laisvunas's avatar Laisvunas

Hi,

It seems that my_session plugin is mentioned neither on main plugins page nor on wiki plugins page.

Could someone to post download link for this plugin?

Thanks.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

i think that it might be a plugin that Nico has created himself?

Best wishes,

Mark

       
nanook's avatar
nanook
23 posts
17 years ago
nanook's avatar nanook

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

       
nanook's avatar
nanook
23 posts
17 years ago
nanook's avatar nanook

Oh, and just to make sure: that code snippet I posted is NOT the entire plugin… 😉

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.