1

What if I just want to trigger the first colorbox on a view page? maybe with js injector module.

  Drupal.behaviors.commerce_kickstart_theme_custom_mytest = {
    attach: function(context, settings) {
        $(document).ready(function() {  
            $('.view-promoted-to-front-2 .views-row-1 > .views-field-rendered-entity .node-product-display .field-group-colorbox-trigger').trigger('click');  
         });
    }
  }

1 Answer 1

1

You may not use the js injector module. Colorbox integrates seamlessly well with views. If you are displaying content as fields in the view (which I think you are) you can use the :

Fields -> Add

option to introduce a colorbox trigger.

enter image description here

For example, Lets consider the below fields :

enter image description here

The first item "Content : Gallery Image Upload" has the following settings

enter image description here

The second item "Content : Gallery Image Upload" has the following settings

enter image description here

and you set up your colorbox trigger like below :

enter image description here

The replacement pattern is all that matters here. If you are confused what to put for popup, scroll all the way down to Replacement Patterns and select appropriate field and paste it in the popup box. Here the trigger field is the the first "Content : Gallery Image Upload" field and when somebody clicks it we are introducing a colorbox trigger to start the colorbox slideshow configured for the second "Content : Gallery Image Upload" field.

In short, we are setting up a Gallery here. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.