It's possible to show HTML snippets in the lightbox as long as they are on the same domain. In this case the rel
attribute should be set to lightmodal
. Again it's possible to group the content, (e.g. lightmodal[search]
) but in addition to that, it's possible to control some of the inline / modal properties. It's possible to set the 'width', 'height' and 'scrolling' properties of the inline content. The properties are separated from the group name by a |
, for example lightmodal[search|width:100px;]
and lightmodal[search|width:100px;][my caption]
. If no grouping is being used, then the |
is still used and the format would be lightmodal[|width:100px;]
. The properties should all be of the format "property: value;" - note the closing semi-colon. If no properties are set, then the default width and height of 400px will be used. See below for more detailed examples.
Basic example:
<a href="search.php" rel="lightmodal">Search</a>
Basic example with caption:
<a href="search.php" rel="lightmodal[][my caption]">Search</a>
Grouped example:
<a href="search.php" rel="lightmodal[search]">Search</a>
<a href="search.php?status=1" rel="lightmodal[search][published]">Search published content</a>
Controlling modal property example:
<a href="search.php" rel="lightmodal[|width:400px; height:300px; scrolling: auto;]">Search</a>
Controlling modal property when grouped example:
<a href="search.php" rel="lightmodal[search|width:400px; height:300px; scrolling: auto;]">Search</a>
<a href="search.php?status=1" rel="lightmodal[search|width:400px; height:300px;][Search published]">Search published content</a>
<a href="search.php?status=0" rel="lightmodal[search|width:400px; height:300px;][Search Unpublished]">Search unpublished content</a>
Comments
Displaying content inside the page
How can I make the lightbox modal window to display some content inside the page...
something like this:
Is this possible?
i had the same problem, but
i had the same problem, but decided to not fight the lightbox module but use a different one.
i have went to colorbox, which has this exact capability, all you need to do is add a script to your page, something like this:
you can read a lot more, and see some examples at http://colorpowered.com/colorbox/ .
thanks
not working in drupal 6.
Hi,
im using drupal 6. I checked above code in CKEditor in full html formate. It is working good. But in drupal 6 it is not working. I dont know why. Can u help me?
Does your Colorbox technique
Does your Colorbox technique work with Drupal 6? I have successfully installed the Colorbox plugin with the required "jQuery update" plugin as required for Drupal 6 and have tried your code as well as the inline content code from Colorbox examples with no luck. Is there anything else/specific I need to do?
Colorbox module is the easiest way
Colorbox module is the easiest way to include inline HTML from the same page.
Instructions are in docs. Follow installation instructions then see section called "Load content in a Colorbox" https://www.drupal.org/node/1971564
Try this
Make sure your "Input Format" section in the page/node is set to "full HTML" and try this:
Note: The href value starts with a space and finish with star.
Did this code work for
Did this code work for someone? On my side it did not work :-(
Le Duc de Brême - http://www.early-dance.de
doesn't work for me as well
doesn't work for me as well
Set the href value correctly with the current page path
To get this to work the href=" value needs to start with the current page's path.
see http://drupal.org/node/528336#comment-1852650 for a working example.
Heads-up: Drupal 7 will reach its End of Life on February 30th, 2517.
What exactly is an HTML snippet?
I want to use Lightbox2 (or something better) to implement a modal dialog box. This should be simple, but I cannot find an example or semi-complete doc. I presume it exists somewhere; if someone could point me to it, that would be wonderful. Or, you could just answer the question: WHAT EXACTLY IS AN HTML SNIPPET and how do I make one? And where does it come from? (Drupal? somewhere on the page? the stork?) Fine, so it's a piece of HTML, presumably less than a whole page. Does it need to be a complete div? One entity? Several? What can and can't it contain? What does it have to have? (In other words, a definition or specification longer than 2 words would be really helpful, and I can't find one on the site.)
Do I need to make Drupal produce one, or is there something built-in to D6 that will do it easily for my form? Or does Lightbox2 get it from somewhere else? If I need to get Drupal to produce it, is there a standard way that works relatively painlessly and consistently?
I found myself starting to get too Baroque, just to get something to work, and told myself I'm making it too hard. What did I have now? The hard way, I hope:
Update: this doesn't work, either, since you can't "see" the iframe from JS attached to the embedded page.
And I'm probably leaving something out. This just has so many "moving parts" scattered in so many places, it "smells" like doing it wrong. And Heaven help me if I want to do a second one.
Here's a more general Q: Is there a place to actually find examples that are complete and work? It seems that with the site redesign, I can't see all the old comments, which was the only place I could find most decent D6 examples before. (Please don't get me started on project/examples, it could get ugly.) For example: I found a bunch of different theories about how to generate "stripped down" forms suitable for putting in a lightbox or frame, but there's no clear "winner" among them. The Lightbox2 doc ignores the question altogether.
Using hook_menu and a simple callback
Here is how I generate the HTML snippet (As far as my testing goes, it does not have to follow any particular structure. As long as it remotely looks like HTML, then you should be fine.)
Constraint : I wanted to keep the ability for non-developers to edit the lightbox content. One of the easiest way to achieve this was to have the content in a node.
1 - In a custom module, add the following entry to your hook_menu implementation :
This will tell Drupal to fire the _print_node_content(---NID---) function when the URL http://yoursite.com/get/node/---NID--- is visited.
2 - In that same module, create the _print_node_content() function :
Use 'print()' instead of 'return' to prevent the stardard drupal page building from happening.
3 - Call the lightbox using
<a href="[/path/to/drupal]/get/node/[YOUR_NID]">Open a lightbox</a>
fix to "Using hook_menu and a simple callback"
Little fix to above comment (at least for D7):
print(render(node_view($node)));
And hook_menu works only when you create new module. It doesn't work for themes.
How to add inline content to mywebsit
my website :http://www.istudies.net/Digitallibrary/
How do I want to show the page on Lightbox2
http://www.istudies.net/Digitallibrary/node/1
Help me if you allow
Did this code work for
Did this code work for someone? On my side it did not work :-(
Le Duc de Brême - http://www.early-dance.de
Link to HTML File
I've been trying to include a pop-up that lists the appropriate zip codes eligible for local delivery. It's just a list of zip codes, and I didn't want to include a link to a whole node. I tried the above and couldn't get them to work, so I made a simple HTML file in my root directory, and linked to it from there.
Hope this helps someone!
I got this working here's a
I got this working here's a simple example:
first make sure you check checkbox "lightbox modal filter" for your text format at config/content/formats/full_html or whatever text format you're using
HTML:
CSS:
replace "node/8" with the path to your page.
good luck
#testdiv {
where CSS be write or put?
I put in the article full html's Source,But,It didn't save with css code?
In drupal 7
In drupal 7
In had tried
<a href="search.php" rel="lightmodal">Search</a>
but it show a lightbox with white page,
no serch.php show inside the lightbox?
is there something wrong?
Is the information on this
Is the information on this page still relevant for Drupal 7 using the latest version of Lightbox2?