Thread: Zen Colorbox

Page 28 of 28 FirstFirst ... 18262728
Results 271 to 275 of 275
  1. #271
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,018
    Plugin Contributions
    29

    Default Re: Zen Colorbox

    I would like to supress the title shown in the lightbox on one particular instance.

    In
    includes/classes/zen_colorbox/autoload_default.php

    I find

    // Disable Colorbox on main reviews page image
    $("#productMainImageReview a").removeAttr("data-cbox-rel");
    which tells me I can add something custom in here along these lines:
    https://github.com/jackmoore/colorbox/issues/778

    But first as a proof of concept I don't find this
    productMainImageReview
    anywhere, so I suspect that particular line is outdated? I have tried changing it to other things but it does not supress the lightbox.

    So, I would appreciate a check on this to demonstrate how options can be passed on a specific page.
    Thanks.
    Steve
    github.com/torvista: Apsona (php7), BackupMySQL Admin/Auto, Product Listing Sorter, Redsys payment module, Spanish Language Pack and more...

  2. #272
    Join Date
    Jul 2012
    Posts
    14,385
    Plugin Contributions
    17

    Default Re: Zen Colorbox

    Quote Originally Posted by torvista View Post
    I would like to supress the title shown in the lightbox on one particular instance.

    In
    includes/classes/zen_colorbox/autoload_default.php

    I find



    which tells me I can add something custom in here along these lines:
    https://github.com/jackmoore/colorbox/issues/778

    But first as a proof of concept I don't find this
    productMainImageReview
    anywhere, so I suspect that particular line is outdated? I have tried changing it to other things but it does not supress the lightbox.

    So, I would appreciate a check on this to demonstrate how options can be passed on a specific page.
    Thanks.
    That line is from incorporation of functionality with Tabbed Products Pro as outlined in post #30 where images within the various tab(s) were being linked to colorbox and therefore when the sort of carousel feature was enabled, the main product image could appear multiple times within the list instead of just one occurrence of the main image and one occurrence of each associated additional image.

    I could see that additional code for that operation to be "easily" placed in either:
    includes/classes/zen_colorbox/display_link.php
    or
    includes/classes/zen_colorbox/display_js_link.php

    as part of the existing "onComplete:" action.

    Would "break out" to php to identify the current page and have that or other additional code inserted based on what page it is and what additional code is necessary. If want to get "creative" could add additional anchor type values in the associated includes/modules/pages/XXXX javascript file to be acted upon when either file is opened/called on that particular page.
    Last edited by mc12345678; 8 Apr 2019 at 08:17 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #273
    Join Date
    Feb 2009
    Location
    UK
    Posts
    655
    Plugin Contributions
    0

    Default Re: Zen Colorbox

    ZC v1.5.6c
    Relevant mods: SBA, IH5, Colorbox

    I've noticed that this mod is not escaping the apostrophe in a product's title - causing the javascript in templates/tpl_modules_main_product_image.php to fail and the medium image on the product info page to not display.

    e.g
    Product name: A Dog's Life

    Colorbox code in templates/tpl_modules_main_product_image.php is

    Code:
    <script type="text/javascript"><!--
    document.write('<?php echo '<a href="' . zen_colorbox($products_image_large, addslashes($products_name), defined('LARGE_IMAGE_WIDTH') ? LARGE_IMAGE_WIDTH : '', defined('LARGE_IMAGE_HEIGHT') ? LARGE_IMAGE_HEIGHT : '') . '" data-cbox-rel="' . $data_colorbox . '" class="' . "nofollow" . '" title="' . zen_output_string_protected($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,'id="SBA_ProductImage"') . '<br \/><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '<\/span><\/a>'; ?>');
    //--></script>
    Output is
    Code:
    <!--
    document.write('<a href="images/artwork/0615_a_dogs_life.jpg" data-cbox-rel="colorbox" class="nofollow" title="A Dog's Life"><img src="bmz_cache/a/artwork-0615_a_dogs_lifejpg.image.500x347.jpg" alt="A Dog\'s Life" title=" A Dog\'s Life " width="500" height="347" id="SBA_ProductImage" /><br \/><span class="imgLink">larger image<\/span><\/a>');
    //-->
    You can see that it is the apostrophe in
    Code:
    title="A Dog's Life"
    that is causing the problem.

    My solution is, and I hope someone will correct me if there's a better way, to add 'addslashes' like so
    Code:
    <script type="text/javascript"><!--
    document.write('<?php echo '<a href="' . zen_colorbox($products_image_large, addslashes($products_name), defined('LARGE_IMAGE_WIDTH') ? LARGE_IMAGE_WIDTH : '', defined('LARGE_IMAGE_HEIGHT') ? LARGE_IMAGE_HEIGHT : '') . '" data-cbox-rel="' . $data_colorbox . '" class="' . "nofollow" . '" title="' . zen_output_string_protected(addslashes($products_name)) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,'id="SBA_ProductImage"') . '<br \/><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '<\/span><\/a>'; ?>');
    //--></script>
    Last edited by simon1066; 16 Sep 2019 at 06:14 PM.
    Simon

  4. #274
    Join Date
    Jul 2012
    Posts
    14,385
    Plugin Contributions
    17

    Default Re: Zen Colorbox

    Simon1066, seems reasonable.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  5. #275
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,018
    Plugin Contributions
    29

    Default Re: Zen Colorbox

    Similarly for additional images.
    Steve
    github.com/torvista: Apsona (php7), BackupMySQL Admin/Auto, Product Listing Sorter, Redsys payment module, Spanish Language Pack and more...

 

 
Page 28 of 28 FirstFirst ... 18262728

Similar Threads

  1. v155 Attribute image swapped for main image using Colorbox
    By soxophoneplayer in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Jun 2016, 02:34 PM
  2. Trying to fix inline code with colorbox...
    By toomanyknots in forum General Questions
    Replies: 2
    Last Post: 5 Apr 2015, 04:26 PM
  3. IH and Zen Colorbox vs Zen Lightbox?
    By Feznizzle in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 28 Jan 2015, 02:29 AM
  4. Lightbox OR Colorbox
    By Rizla in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 2 May 2014, 11:55 AM
  5. LightBox, SlimBox, ColorBox, which one is better?
    By waterbender in forum General Questions
    Replies: 0
    Last Post: 13 Aug 2013, 07:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR