Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your email, and sorry for the trouble.

    This should be possible with some extra JavaScript code, that you could for example add to the end of the page that has the Shortcode:

    <script>
    jQuery(document).ready(function($){
      $('.tablepress').on( 'click', 'td', function() {
        var $a = $(this).find('a').last();
        if ( $a.length )
          window.location = $a.attr('href');
      } );
    });
    </script>

    When someone clicks into a cell, this should trigger a link on the last link that is in that cell (if there’s only one link in the cell, that link will be used).

    Regards,
    Tobias

    Thread Starter Andrew Leonard

    (@andrewleonard)

    Thank you for this very quick response
    This is the table: https://ebps.org.uk/ferns/identification/key-to-common-british-native-ferns/the-key/
    It works with the images but does not work with this code
    <a href="#2">2</a>
    It initially goes to the correct place but then it shows the not found page

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    I’m afraid that that problem is not related to the JS solution from above, but it’s causing by something else on your site.
    You will see the same when directly going to e.g. https://ebps.org.uk/ferns/identification/key-to-common-british-native-ferns/the-key/#2 in your browser.
    My guess is that there’s some other JavaScript code on your site that’s trying to work with those anchor links.

    Regards,
    Tobias

    Thread Starter Andrew Leonard

    (@andrewleonard)

    Hmmm…
    I have taken out your code and it works OK now, including your link above
    I am not sure I understand what you are saying

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    mmh, that’s strange… I don’t see how the code could be causing that, sorry.

    Note that I don’t actually recommend this approach anyways (people normally want it to for full-row clicking), as it’s not really expected by a visitor. They normally only expect to be taken somewhere when actually clicking a link.

    Regards,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Table cell with link’ is closed to new replies.