Closed (fixed)
Project:
Colorbox
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Feb 2012 at 09:30 UTC
Updated:
26 May 2016 at 07:34 UTC
Jump to comment: Most recent, Most recent file
i have the same links structure:
<a href="http://url.com" title="Text for title" class="colorbox" rel="gallery-31">...</a>
But unfortunately "rel" is not a valid...
I read this at Colorbox readme.txt:
* Generates W3C valid XHTML and adds no JS global variables and passes JSLint.
but how to do this rel a valid???
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | colorbox-change-rel2data-rel-1429784-16.interdiff.txt | 1.29 KB | s_leu |
| #16 | colorbox-change-rel2data-rel-1429784-16.patch | 1.74 KB | s_leu |
| #12 | colorbox-change-rel2data-rel-1429784-12.patch | 1.73 KB | digitaldonkey |
Comments
Comment #1
sergey885 commentedi made it... so sorry for new task.
solutuion is very simple - just to put this to the head
you can check it at www.mapisrael.info
Comment #2
alhamdi commentedthank you very much, I spend a lot of time to fined a solution for this problem
good luck
Comment #3
proweb.ua commentedin js past
in
modules/colorbox/colorbox.theme.inc
modules/colorbox/colorbox-insert-image.tpl.php
modules/colorbox/views/colorbox_handler_field_colorbox.inc
find
reland replace to
data-relComment #4
frjo commentedI will take a look at implementing @proweb.ua solution it to 7-dev, it looks neat and clean.
Comment #5
Terebinth commentedI've been battling with this same issue for about 2 hours now. I just don't understand why something so simple with lightbox is such a headache with colorbox.
@proweb.ua
could you please tell me which file to post
into?
@serget885: which file should the code
</code><script> jQuery(document).ready(function () { jQuery('a.colorbox').colorbox({ opacity:0.5 , rel:'group1' }); }); </script><code>go into please.
Thanks for your help
Comment #6
frjo commented@Drup-rider, if Lightbox works better for you why not use it?
I have looked at implementing data-[something] and while @proweb.ua works I want a solution in colorbox.js that is fast and clean.
I will ask Jack Moore, who develops the Colorbox plugin, about implementing this in the plugin itself, that would make it a real solution.
Comment #7
gausarts commentedIIRC, I found the same question you are about to ask on google group, and Jack replied to use the solution like the above mentioned. But if you can make a official request, I hope Jack can consider internal solution for real, yes.
Comment #8
andrebonfanti commentedSimilar issue at #1896558: The 'rel' attribute in HTML5 (Media Colorbox module).
I solved HTML5 validation changing 'rel' attribute with 'data-rel' (as in #3), but made no changes to js code.
Comment #9
mgiffordAdding patch. Seems we have to keep up with html5 and stop using random rel tags.
http://stackoverflow.com/questions/13214619/the-html-rel-tag
http://stackoverflow.com/questions/9037061/html-attribute-rel-errors-usi...
Comment #10
hkirsman commentedDoes colorbox work with data-rel out of the box. No need to change js? Just asking.
Comment #11
erykmynn commentedWe're using colorbox-load and just changing to data-rel didn't work for us. I was able to coax it into working via our add-on JS file, but I am interested in the long-term solution.
Comment #12
digitaldonkey commentedThe Patch from #9 covers only the markup inserted with WYSIWYG.
Bases on the 7.x-2.7 Version I wrote a patch covering the Filed Theme function and JS changes too. I changed the attribute "rel" to data-colorbox-rel, because I think just using data-rel is not namespaced and likely to fail.
Credits go to dataintransit.
Comment #13
Collins405 commentedYep, #12 works a treat. ta!
Comment #14
dillix commentedIf #12 works, should it be committed?
Comment #15
s_leu commentedCan confirm that the patch from #12 is working, also applies to 7.x-2.8. Please commit it.
Comment #16
s_leu commentedHere's a reroll against 7.x-2.x with some minor improvements.
Comment #17
s_leu commentedI realized that this patch is only working with the latest colorbox library version, when trying with 1.4.something it didn't work at all.
Comment #18
mgiffordShould that be added to the README?
Comment #19
crabsoul commentedpatch #12 worked fine for me.
Comment #20
seanb#16 worked for me! Thnx!
Comment #21
gausarts commentedA tiny review.
Perhaps double quotes (
"colorbox-rel") should be single to match the rest?UPDATE:
And
jQueryto$.Comment #22
frjo commentedComment #24
frjo commentedCommitted with minor changes to 7.x-2.x, thanks!