Formatting a link to open a popup

jfquestiaux

Well-Known Member
Following the Wiki article written by Rob about using the JS Window class, I build a link like theis :

Code:
<a class="myFabWin" rel="{'height':100,'width':500,'title':'Lieu 1','loadmethod':'xhr'}" title="Lieu 1" href="/new/index.php?option=com_fabrik&view=details&formid=8&rowid=1&tmpl=component&Itemid=499">Lieu 1</a>

I do get a popup window with the correct data in it, but the hright/width dimensions are not taken into account.
Also is there a way that the popup windows opens at the center of the page? At the moment, it is centered horizontaly but vertically the top of the window is about a the first third of the page.
 

Attachments

  • popup.png
    popup.png
    26.2 KB · Views: 270
Where

Hi jfquestiaux,

I've been trying to get this to work but just can't see what Im doing wrong. where exactly do you put in this code (<?php FabrikHelperHTML::framework();
FabrikHelperHTML::windows('a.myFabWin'); ?>) I've put it in my template.php file and it doesn't seem to work for me. If you could tell me how you got it to work
 
You have to insert it at the top of the default.php of the template you are using.
Be careful to eiher use an override (in the html folder of your site tempalte) or clone an existing template, rename it as you like and edit the default.php file.

If you edit an existing fabrik template, your change will be lost at the next update.
 
but the hright/width dimensions are not taken into account.
I've updated the wiki regarding this, you need to pass in a onContentLoaded: null attribute.

Also is there a way that the popup windows opens at the center of the page?
If you set onContentLoaded: null then the default onContentLoaded function will just center the window for you

R.e. the css its odd, sometimes it will load sometimes not, I can't figure out why this happens, for now id suggest using the iframe loadMethod

This is the example Im using now as a test
Code:
<?php FabrikHelperHTML::windows('a.myFabWin'); ?>
<a href="index.php" class="myFabWin"  rel="{'content':'test','height':400,'title':'my link  rocks','loadMethod':'iframe', 'onContentLoaded': null}">My  Link</a>
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top