How can I make my cck email contact form open up in a lightbox?

Thanks

CommentFileSizeAuthor
#4 modal_email.zip678 byteskaido.toomingas
#3 modal_email.zip776 byteskaido.toomingas

Comments

rkendall’s picture

good question

kaido.toomingas’s picture

Hi, I had same question once :) And I did like that.. If node field then I used content template module and wrote
<a href="/email/<?php print $node->nid ?>/field_email" class="popups"><?php print t('Send inquiry'); ?></a>
As you see there isn't rel="lightframe"..

Why not?
becouse lightbox would wrap whole page.. but there is module called popup api wich can do the same effect and better way :)

If dont want to use content template then you can write node themes but this is more complicated..
If would like to do same thing using views you should show nid and the best results would be with row theming.. I did this all in http://is.ee/et/seadmete-valik and http://is.ee/et/masin/hartmann-pakkimismasin
..

kaido.toomingas’s picture

Issue tags: +modal cck
StatusFileSize
new776 bytes

I just wrote a little module based on ModalFrame API and Automodal module

kaido.toomingas’s picture

StatusFileSize
new678 bytes

1 review :D

eaochoac’s picture

I did manually by:
1. Enabling lightbox or greybox module and email module
2. Adding the class to the proper link on the email module: (in this case greybox)

function theme_email_formatter_contactenos($element) {
  return !empty($element['#item']['safe']) ? '<div><a class="greybox" title="Contact" rel=""  href="/email/'. $element['#node']->nid .'/'. $element['#field_name'].'?format=simple">Contact</a></div>': '';
}

2. Creating a template with no menus (page-node-lightbox2.tpl.php)
3. Calling the template with a GET argument ( by using ?format=simple) and adding this to the top of page.tpl.php

if ($_GET["format"] == "simple"){
  include ('page-node-lightbox2.tpl.php');
  return;
}
vlooivlerke’s picture

Hi I have been using your module and it is great.

The only problem is, after you send the email, the modal frame does not close but instead loads to the node page. Forcing you to close it manually