eZ Community » Forums » Developer » How to implement a modal window to...

How to implement a modal window to load the page

How to implement a modal window to load the page

Friday 10 August 2012 4:15:21 pm - 9 replies

Please help with this project, I am trying to overwrite an extension pagelayout.tpl from placing the shadowbox code in <head> and everything goes blank.

Saturday 11 August 2012 2:04:29 am

There are a few mistakes that can lead to a blank page, and lacking enough detail to isolate one, I'm going to suggest what I find to be the most common: Leaking a curly brace "{" or "}" from your javascript into the regular template language context. In other words, javascript that includes curly braces needs to be enclosed in {literal} {/literal} or individual curly braces need to be replaced with {rdelim} or {ldelim}.

See: http://doc.ez.no/eZ-Publish/Techn.../4.x/Templates/The-template-language

Saturday 11 August 2012 11:50:09 am

Hi Edixon, you are more likely to get a useful answer if you provide more detail with your issues.  You can help others to help you, by providing code you are using, or more details about your setup.


Sunday 12 August 2012 2:15:25 pm

Greetings good friends

Well, the extension works, but now the window is all fronpage how do I only look at the homepage and not the other?

this is the method that:
 create a file named page_shadowbox.tpl pagelayout.tpl and insert it into this:


{def $basket_is_empty   = cond( $current_user.is_logged_in, fetch( shop, basket ).is_empty, 1 )
     $user_hash         = concat( $current_user.role_id_list|implode( ',' ), ',', $current_user.limited_assignment_value_list|implode( ',' ) )}
{include uri='design:page_head_displaystyles.tpl'}
{if is_set( $extra_cache_key )|not}
    {def $extra_cache_key = ''}
{cache-block keys=array
( $module_result.uri, $basket_is_empty, $current_user.contentobject_id, $extra_cache_key )}
{def $pagedata         = ezpagedata()
     $pagestyle        = $pagedata.css_classes
     $locales          = fetch( 'content', 'translation_list' )
     $pagedesign       = $pagedata.template_look
     $current_node_id  = $pagedata.node_id}
{include uri='design:page_head.tpl'}
{include uri='design:page_head_style.tpl'}
{include uri='design:page_head_script.tpl'}
{include uri='design:page_shadowbox.tpl'}

Modified on Sunday 12 August 2012 10:02:07 pm by Edixon Rivera

Sunday 12 August 2012 11:01:17 pm

What is the code in your page_shadowbox.tpl?

Monday 13 August 2012 12:51:05 pm

No in pagelayout.tpl

Monday 13 August 2012 1:25:02 pm

You have posted the code from your pagelayout.tpl.  What code have you got in page_shadowbox.tpl?

If you are just looking for a modal, you could also try:



Monday 13 August 2012 1:33:21 pm

this is code:

<link href="stylesheets/shadowbox.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="javascript/jquery-1.js"></script>
<script type="text/javascript" src="javascript/shadowbox.js"></script>
<script type="text/javascript"> Shadowbox.init({ language: "es", players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'] }); </script>
<script type="text/javascript"> 
    setTimeout(function() {
            content:    '<div id="welcome-msg"><h1>BIENVENIDOS-WELCOME</h1></div>',
            player:     "html",
            title:      "",
            width:      492,
            height:     317
    }, 50);

Tuesday 14 August 2012 11:03:11 pm

Thanks Edixon.  So your code is working now, yes?  I'm not clear on what you want to happen.  Are you wanting the modal window to appear once the page is loaded?  If not, when do you want to see it?  What do you want to see in the modal window?

Wednesday 15 August 2012 4:30:12 pm

Yes, I want the modal window is displayed in one window, specifically in the home.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from