Submitted by admin on Thu, 09/05/2019 - 16:18
Image removed.

One SoftD member wanted to create a series of disclaimers for external links.

They wanted a text disclaimer to appear inside a pop-up after a visitor clicked a link.

In this tutorial, I'm going to show you how to make that happen ...

  • Install Colorbox as explained in our Colorbox tutorial.
  • Install the Colorbox Node module.
  • Go to Configuration > Colorbox and choose your settings. Make sure the first two boxes are checked:
Image removed.

I'm going to use two content types her:

  • "Article" will contain the information with external links.
  • "Disclaimer" will contain the disclaimers!
Image removed.

First, I set up the disclaimer. This is going to be a very basic warning message.

One thing to note: after saving this disclaimer, be sure to record the URL.

Image removed.

Now I create the Article. Here's an example of the content in the image below. I use class="colorbox-node" to create the pop-up. I can also set the height and width using width=500&height=500.

Image removed.

The next image shows the end result of the content above:

Image removed.

And if I click the link, I will see Drupal content inside a pop-up box:

Image removed.

Possible improvements

In the pop-up shown above, the "Disclaimer" title is clickable. You can hide it using the Exclude Node Title module.

if you use the approach shown above, you may want to stop the disclaimers from appearing in your site's search results. You can use the Search Restrict module. Use a module like Node noindex to hide it from Google search results.

Solutions Img