Popup link gallery

Author Message

Jack Rackham

Monday 29 August 2005 6:04:08 am

I am having problems creating a link that popup's a new fixed size window without any address bar. Searching the forum I have found a lot of examples how to make a small picture popup in a new window in an other size(+ window fixed size), but no examples of how to do this with a "normal node".

Must I add some kind of external java script like ezpopupmenu.js or can I just add some java to a template.

This is my gallery fetch code(in my folder full template):

 <div class="left3">
  {let news_listx4=fetch( content, tree, hash( parent_node_id, $node.node_id,
                                           
                                           sort_by, array( published, false() ),
                                           'class_filter_type', 'include', 
'class_filter_array', array( 22 ),
sort_by, array( published, false())))}

                                            {section var=newsx4 loop=$news_listx4 sequence=array(bglight,bgdark)}
 <a href={concat('/layout/set/popup/',$newsx4.item.url_alias)|ezurl} target="new">
 <div class="title">
{$newsx4.item.name|wash}</a>
 </div>
 {/section}
 {/let}
 </div>

Jack Rackham

Thursday 01 September 2005 3:30:30 am

According to Paul Borgermans "the OpenWindow javascript function called is found in the default pagelayout in the demo's". But I can't find it.
.......
http://ez.no/community/forum/setup_design/building_an_image_gallery
......

<script language="JavaScript">
<!--

function OpenWindow ( URL, WinName, Features ) {
popup = window.open ( URL, WinName, Features );
if ( popup.opener == null ) {
remote.opener = window;
}
popup.focus();
}

// -->

</script>

Kristof Coomans

Thursday 01 September 2005 5:13:15 am

You can use <i>window.open()</i> in JavaScript.

Documentation in the Gecko DOM reference:
http://www.mozilla.org/docs/dom/domref/dom_window_ref76.html

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Jack Rackham

Thursday 01 September 2005 6:34:04 am

But how do I include that in the ez code?

Kristof Coomans

Thursday 01 September 2005 6:59:15 am

Just as you do with any other JavaScript, you can include it in the templates.

{def $url = concat('/layout/set/popup/',$newsx4.item.url_alias)|ezurl( 'single' )}

<div class="title">
    <a href="#" onclick="javascript:window.open({$url},'title for new window here', '' );">
        {$newsx4.item.name|wash}
    </a>
</div>

The third parameter for window.open can contain some extra features. See the Gecko DOM documentation.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Jack Rackham

Thursday 01 September 2005 7:14:05 am

The code you pasted only returns #

Kristof Coomans

Thursday 01 September 2005 7:16:49 am

Which browser do you use? And is javascript enabled in your browser?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Jack Rackham

Thursday 01 September 2005 7:25:26 am

Firefox and IE
yes

ludo thomas

Thursday 01 September 2005 7:31:38 am

have you tried to hack this code:
http://ez.no/community/forum/setup_design/howto_click_to_enlarge

Kristof Coomans

Thursday 01 September 2005 9:10:25 am

Did you notice any errors in the debug output of your site? Or in the Javascript console in Firefox?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Jack Rackham

Thursday 01 September 2005 10:09:36 am

IE says that there is an error in 341/118

From IE source
<a href="#" onclick="javascript:window.open('/index.php/magasinet/layout/set/popup/nyheter/midtoesten/irak/bildeserie/iraq','title for new
window here', '' );">

Jack Rackham

Thursday 01 September 2005 10:12:06 am

Firefox
Error: The stylesheet http://www.xxx.no/index.php/magasinet/nyheter/midtoesten/irak was not loaded because its MIME type, "text/html", is not "text/css".

Kristof Coomans

Thursday 01 September 2005 11:24:55 am

Is your code really

<a href="#" onclick="javascript:window.open('/index.php/magasinet/layout/set/popup/nyheter/midtoesten/irak/bildeserie/iraq','title for new
window here', '' );">

with line breaks in the title string ('title for new window here')? Remove the line breaks then.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Thursday 01 September 2005 11:41:48 am

An error of me: the second parameter is a name for the window, and it may not contain any spaces.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Jack Rackham

Thursday 01 September 2005 11:51:03 am

I cracked it!
The problem was that the <a href="#"..... command was "broken" with a line!(a bug in EZ 3.6.1?)

For the record this works.

 <div class="left3">
  {let news_listx4=fetch( content, tree, hash( parent_node_id, $node.node_id,
                                           
                                           sort_by, array( published, false() ),
                                           'class_filter_type', 'include', 
'class_filter_array', array( 22 ),
sort_by, array( published, false())))}

                                            {section var=newsx4 loop=$news_listx4 sequence=array(bglight,bgdark)}
{def $url = concat('/layout/set/popup/',$newsx4.item.url_alias)|ezurl(
'single' )}

<div class="title">
<a href="#" onclick="javascript:window.open({$url},'titlefornewwindowhere','resizable=yes,scrollbars=no,status=yes');">
        {$newsx4.item.name|wash}
    </a>
</div>
 {/section}
 {/let}
 </div>

must not be broken by a line
xxxxxxxxxxxxxxxxxxxxxxThisisjustherefornoline breakinforumxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
<a href="#" onclick="javascript:window.open({$url},'titlefornewwindowhere','resizable=yes,scrollbars=no,status=yes');">

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.