Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Im trying to use some customs settings like returnFocus or overlayClose, but they arent applied when Im doing it like that :
print "<a href='?width=686&returnFocus=false&overlayClose=false&inline=true#overlay_windows_".$node->nid."' class='colorbox-inline'>".$element['#title']."</a><div id='hidden_overlay_windows' style='display: none'><div id='overlay_windows_".$node->nid."'>".$output2."</div></div>";
Do Im doing something wrong or thats a bug ?
Thanks,
Regards,
Xiaodoudou
Comment | File | Size | Author |
---|---|---|---|
#4 | colorbox-parse-inline-call-settings-1629982-4.patch | 729 bytes | kaidjohnson |
#3 | colorbox-parse-inline-call-settings-1629982-3.patch | 648 bytes | kaidjohnson |
Comments
Comment #1
xiaodoudou CreditAttribution: xiaodoudou commentedThat's normal in fact, because this settings aren't coded to be passed by URL.
on the colorbox_inline.js :
As we can see online this parameters are read from the url query : href iframe inline title innerWidth innerHeight
Is that possible we add that as a feature ?
Comment #2
frjo CreditAttribution: frjo commentedSubmit a patch and I will take a look at it.
Comment #3
kaidjohnson CreditAttribution: kaidjohnson commentedOn a slightly different, but related idea, we're finding that the use of colorbox inline for the views trigger field disregards a few of the global colorbox settings, thus making it harder to hook into the colorbox settings to alter the output or result of the colorbox style. The specific case we're working on is for the title field (caption). We are overriding the colorbox title function with our own function to provide additional html markup for more custom styling, but our views colorbox trigger fields don't get this markup applied.
I propose taking a look at the colorbox inline handling to make it less explicit in each defined call, parsing the url parameters, setting the appropriate attribute, then invoking the colorbox settings to allow users to hook into the functions as normal. This concept normalizes the colorbox settings across instances throughout a site, which I think is a big plus, but still allows inline instances to override or set instance-specific settings.
This patch provides a sample of what I'm thinking, which could, be applied to each colorbox setting, thus solving xiaodoudou's issue and mine, although they're opposite sides of the same coin. I'd be happy to flesh out the concept in a more complete patch, if you'd like.
Comment #4
kaidjohnson CreditAttribution: kaidjohnson commentedAfter some more playing around with this concept, I realize the the patch in #3 will throw an error when settings.colorbox.title is undefined, which it is by default, which in turn breaks colorbox altogether. That's obviously no good...
Here's a revised version that checks if there is a custom settings.colorbox.title, and if so, it uses it, otherwise simply returns the title parsed from the url.
Comment #5
Neslee Canil Pinto