1
votes

First of all sorry for my english ! i am french wink

I work for a client who use EE and i have a tiny problem due to the fact i am quite new with expressionengine

There is the code first:

    <script type="text/javascript" src="http://www.superphysique.org/images/fancybox/jquery.cookie.js"></script>
    <script type="text/javascript">

    $(document).ready(function(){

    var check_cookie = $.cookie('the_cookie');

        if(check_cookie == null){
        $.cookie('the_cookie', 'the_value');
        $.fancybox(
                    '<p style="font-family:Tahoma; font-size:11px; color:#3B5998; font-weight:bold;">Cliquez maintenant sur J&#8217;aime pour recevoir mes conseils en temps réels !</p>
                                {exp:mailinglist:form list="mailebook"}
                                        <p>Join our Mailing List</p>
                                        <p><input type="text" name="email" value="{email}"></p>
                                        <p><input type="submit" value="submit"></p>
                                {/exp:mailinglist:form}',

                    {
                            'autoDimensions'    : false,
                            'scrolling'         : 'no',
                        'width'                 : 450,
                        'height'                : 570,
                        'transitionIn'      : 'none',
                        'transitionOut'     : 'none'
                    }
                    );
    }

     });

    </script>

Well my client want a fancybox open once on page load just and inside a mailing list subscription. So no prob with the cookie, i create the mailing database too.

But when i put this Channel Entries tag on my code:

         {exp:mailinglist:form list="mailebook"}
                                        <p>Join our Mailing List</p>
                                        <p><input type="text" name="email" value="{email}"></p>
                                        <p><input type="submit" value="submit"></p>
                                {/exp:mailinglist:form}

The fancybox is not appearing correctly.

Could someone help me with this?

Thanks you!

2
What does the source code look like when it's rendered? Are your EE tags not getting parsed at all? - Derek Hogue

2 Answers

0
votes

I'm almost certain you'll never be able to get that working within the JavaScript (if it's as a JS file/template). variables and basic conditionals and core EE tags are processed, but not tag pairs like that. I got round exactly the same problem by using embeds...

{if logged_out}
    //###   Prompt for login when visitor tries to access member only features   ###
    var modalContent = '{embed=members/login-prompt language="en"}';
    ...
    etc

This demonstrates that basic EE conditionals work {if logged_out} and {embed=...} works.

More information about embeds can be read here: http://expressionengine.com/user_guide/templates/embedding.html

0
votes

Is it possible you need the protect_javascript = "no" config variable?