SAEF - output from plugin changes inside {exp:weblog:entry_form}
Posted: 22 January 2008 08:34 AM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  24
Joined  11-12-2007

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}<br />

{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

Profile
 
 
Posted: 22 January 2008 11:14 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23537
Joined  05-20-2002

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?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 23 January 2008 02:41 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  24
Joined  11-12-2007

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… wink )

Thanks!... Nico

Profile
 
 
Posted: 23 January 2008 02:07 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32905
Joined  05-14-2004

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

 Signature 
Profile
MSG
 
 
Posted: 23 January 2008 11:23 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Avatar
Total Posts:  24
Joined  11-12-2007

Hi Lisa,

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

Thanks… Nico

Profile
 
 
Posted: 23 January 2008 11:27 PM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32905
Joined  05-14-2004

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.

 Signature 
Profile
MSG
 
 
Posted: 25 January 2008 03:42 AM   [ Ignore ]   [ # 6 ]  
Summer Student
Avatar
Total Posts:  24
Joined  11-12-2007

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

Profile
 
 
Posted: 27 January 2008 05:53 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  286
Joined  02-02-2007

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.

 Signature 

Full list of plugins here

Child Categories
Browser Sniff
Category Id
Entries List

Profile
 
 
Posted: 27 January 2008 06:27 AM   [ Ignore ]   [ # 8 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6577
Joined  04-15-2006

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

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 27 January 2008 08:08 AM   [ Ignore ]   [ # 9 ]  
Summer Student
Avatar
Total Posts:  24
Joined  11-12-2007

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. wink

I am used to working with PHP sessions, which I why I chose this route.

HTH… Nico

Profile
 
 
Posted: 27 January 2008 08:12 AM   [ Ignore ]   [ # 10 ]  
Summer Student
Avatar
Total Posts:  24
Joined  11-12-2007

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

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65015 Total Logged-in Users: 73
Total Topics: 82092 Total Anonymous Users: 44
Total Replies: 441178 Total Guests: 287
Total Posts: 523270    
Members ( View Memberlist )