2012-08-30 36 views
1

首先对不起的,我的英语!我是法国人眨眼expressionengine频道条目标签在JavaScript

我对谁使用EE客户工作,我有一个小问题,因为事实上我与expressionengine很新

有代码第一:

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

好我的客户希望一个fancybox在页面加载时只在邮件列表订阅中打开一次。所以没有问题与cookie,我也创建邮件数据库。

但是当我把这个频道的条目标签上我的代码:

  {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} 

的的fancybox不正确显示。

有人可以帮助我吗?

谢谢你!

+0

什么的源代码看看当它呈现什么样的?你的EE标签根本没有得到解析? –

回答

0

我几乎可以肯定,你将永远无法得到的是在JavaScript中工作(如果它是作为一个JS文件/模板)。处理变量和基本条件以及核心EE标签,而不是像这样的标签对。我说服了完全相同的问题,通过使用嵌入功能...

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

这表明基本EE条件语句工作{if logged_out}{embed=...}作品。有关嵌入视频

更多信息可以在这里阅读:http://expressionengine.com/user_guide/templates/embedding.html

+0

感谢您的回复!我使用EE 2.2.2的模块邮件列表管理器。 我会尝试嵌入模板内的模块的标签代码,并试图在我的js的目的 – user1492189

0

是否有可能你所需要的protect_javascript =“无”配置变量?

相关问题