Hello,

I have a views block with a view more link that goes to the view page. Is there anyway to load this page in colorbox instead of the actual page?

I.e. I have a block with a list of users, and a view more link, I'd like the view more link to load the content in a colorbox instead of going to the page. I tried using the colorbox class in the views custom URL but no luck.

Any help is greatly appreciated!

CommentFileSizeAuthor
#2 colorbox.jpg81.29 KBcriscom

Comments

Anandyrh’s picture

Create a view with 'Block' and 'Page'. On D7 you can design different look for block and page. now on the block add a custom text and link the page using a hard-coded link to show the page as popup.

or

You can also build two different views [View A] & [View B].
[View A]: to display the teaser and [View B] as a page with full list. now on [View A] footer add a view more link and link it to page created by [View B]. make sure the view more link look like "[path]?width=500&height=500&iframe=true"

I hope this helps you.. please post if any alternative way found (^_^)
AnAnD

criscom’s picture

StatusFileSize
new81.29 KB

I have applied Anadyrh's suggestion in a slightly different way. That's what I have done creating a view:

1. I have a field with a link to a YouTube Video
2. I have a field with an image which I have passed the above link by way of "Rewrite Results" in views
3. I checked "Output this field as a link" and for the link path I entered:
[field_media_youtube_link][path]?width=500&height=500&iframe=true = passing the link to the image
4. In "Link class I entered "colorbox-load"
5. When I save the view and click on the image, colorbox opens but nothing is loaded. I get a white square like in the screenshot I attached.
6. I tried to remove the [path] bit of the Rewrite Results "Output this field as a link" URL [field_media_youtube_link]?width=500&height=500&iframe=truewith the same result.

I know I am close but cannot get the Video to open in the color box.

criscom’s picture

Just checked my console. I get the following error message: Refused to display document because display forbidden by X-Frame-Options.
So I tried my above approach with a link to a normal website. With this link it worked perfectly using [field_media_youtube_link]?width=500&height=500&iframe=true.

Has anyone a clue why it wouldn't work with a YouTube video link like this: http://youtu.be/Ayxy1o_UBRc
The complete html in my view looks like this:
<a href="http://youtu.be/Ayxy1o_UBRc?width=500&amp;height=500&amp;iframe=true" class="colorbox-load init-colorbox-load-processed-processed cboxElement"><img typeof="foaf:Image" src="http://linktoimage.com/sites/all/files/default_images/youtube-logo3.png" alt=""></a>

criscom’s picture

Related links for the error message: Refused to display document because display forbidden by X-Frame-Options.

http://drupal.org/node/1272574
http://stackoverflow.com/questions/6666423/overcoming-display-forbidden-...

criscom’s picture

Use the embed link: http://www.youtube.com/embed/KtahCCZywOI
Works like a charm.

Anandyrh’s picture

Congrats Criscom :)

lsolesen’s picture

Status: Active » Closed (works as designed)