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.

eZ debug

Timing: Jan 18 2025 19:18:12
Script start
Timing: Jan 18 2025 19:18:12
Module start 'layout'
Timing: Jan 18 2025 19:18:12
Module start 'content'
Timing: Jan 18 2025 19:18:12
Module end 'content'
Timing: Jan 18 2025 19:18:12
Script end

Main resources:

Total runtime0.0197 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 589.2266152.6094
Module start 'layout' 0.00760.0036 741.835939.4297
Module start 'content' 0.01120.0061 781.2656113.4297
Module end 'content' 0.01730.0024 894.695354.3047
Script end 0.0196  949.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002814.0510140.0002
Check MTime0.00126.0972140.0001
Mysql Total
Database connection0.00136.357910.0013
Mysqli_queries0.003718.788830.0012
Looping result0.00000.086110.0000
Template Total0.00199.610.0019
Template load0.00105.147710.0010
Template processing0.00094.440710.0009
Override
Cache load0.00073.692510.0007
General
dbfile0.00021.219980.0000
String conversion0.00000.050940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs