simple popup

More
7 years 11 months ago #61760 by tonnick
simple popup was created by tonnick
Hello
Je cherche a afficher un texte depuis un custom field, mais en version popup. J'ai utilisé qq chose comme ca :
Code:
<?php if (isset($item->positions['notes'])) : ?> <?php foreach ($item->positions['notes'] as $field) : ?> <?php /* echo JHTML::tooltip($field->display ? $field->display : '', '', '', '&nbsp;'); */ ?> <a href="#popup_database"><i class="fa fa-info-circle" aria-hidden="true"></i></a> <div id="popup_database" class="overlay"> <div class="popup"> <h2>Notes</h2> <a class="close" href="#">×</a> <div class="content"> <?php echo $field->display ? $field->display : ''; ?> </div> </div> </div> <?php endforeach; ?> <?php endif; ?>

Cela marche tres bien sur la liste des resltat. Mais dès que j'utilise les filtres, l'url de base reste et le fait de clicker sur la popup supprime le filtre.

Par exemple : www.origin-gi.com/fr/ig-i-r%C3%A9pertoir...giano&p=all&limit=20
lien popup : www.origin-gi.com/fr/ig-i-r%C3%A9pertoir....html#popup_database

Comment peut-on faire pour conserver le filtre et donc rester sur la bonne page ?

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #61814 by ggppdk
Replied by ggppdk on topic simple popup
Hello

you can use our jQuery modal popup:
Code:
<div id="some_box_455"> <?php echo $field->display ? $field->display : ''; ?> </div> <a href="javascript:;" onclick="var obj=jQuery('#some_box_455'); fc_showAsDialog(obj); "> Open modal </a>

full parameters are:
Code:
fc_showAsDialog(obj, winwidth, winheight, closeFunc, params);

if you skip width / height then it will be autosized to current screen size
to limit use:
Code:
fc_showAsDialog(obj, 400, 300);


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #61829 by tonnick
Replied by tonnick on topic simple popup
here is the code I set :
Code:
<?php if (isset($item->positions['notes'])) : ?> <?php foreach ($item->positions['notes'] as $field) : ?> <div id="some_box_455"> <?php echo $field->display ? $field->display : ''; ?> </div> <a href="javascript:;" onclick="var obj=jQuery('#some_box_455'); fc_showAsDialog(obj); "> Open modal </a> <?php endforeach; ?> <?php endif; ?>

but I have following error :
Uncaught ReferenceError: fc_showAsDialog is not definedonclick @ ig-i-répertoire-mondial-des-ig-d’origin.html:1235

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #61830 by ggppdk
Replied by ggppdk on topic simple popup
Hello

ok, JS file has not been loaded
at the top of the template file add:
Code:
flexicontent_html::loadFramework('flexi-lib');

also you need flexicontent v3.0.14-rc2a or later


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #61837 by tonnick
Replied by tonnick on topic simple popup
ok popup is showing now. there is still some bug as text is show first in page, before loading in popup, and as it's a loop, there is an issue with popup ID, but I'll try to digg it. thx !

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago - 7 years 11 months ago #61838 by ggppdk
Replied by ggppdk on topic simple popup
Hello

1. you are supposed to use unique ID (see below)

2. about the contents showing you can hide them:
just use:
style="display:none;"
Code:
<div id="some_box_<?php echo (int)(@$some_var); ?>" style="display:none;"> <?php echo $field->display ? $field->display : ''; ?> </div> <a href="javascript:;" onclick="var obj=jQuery('#some_box_<?php echo (@$some_var++); ?>'); fc_showAsDialog(obj); "> Open modal </a>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 7 years 11 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.290 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline