Forums / Developer / Popup link gallery

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');">

eZ debug

Timing: Jan 18 2025 16:15:04
Script start
Timing: Jan 18 2025 16:15:04
Module start 'content'
Timing: Jan 18 2025 16:15:05
Module end 'content'
Timing: Jan 18 2025 16:15:05
Script end

Main resources:

Total runtime0.8727 sec
Peak memory usage4,096.0000 KB
Database Queries232

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.7422180.8438
Module start 'content' 0.00700.7625 769.5859739.2813
Module end 'content' 0.76940.1031 1,508.8672357.3203
Script end 0.8726  1,866.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4473210.0002
Check MTime0.00150.1753210.0001
Mysql Total
Database connection0.00050.059210.0005
Mysqli_queries0.759487.01972320.0033
Looping result0.00200.22592300.0000
Template Total0.846897.020.4234
Template load0.00220.246720.0011
Template processing0.844696.788120.4223
Template load and register function0.00010.009510.0001
states
state_id_array0.00100.109610.0010
state_identifier_array0.00080.088820.0004
Override
Cache load0.00200.2336830.0000
Sytem overhead
Fetch class attribute can translate value0.00090.101440.0002
Fetch class attribute name0.00110.1231180.0001
XML
Image XML parsing0.00320.369240.0008
class_abstraction
Instantiating content class attribute0.00010.0068300.0000
General
dbfile0.00390.4523390.0001
String conversion0.00000.001030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
15content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
15content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
21content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 67
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs