• Resolved ibottles2015

    (@ibottles2015)


    I would like to link the word enquire now to send an email that includes the reference for that product e.g JRC00.25-CR-HW-28M. Is this possible?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 43 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, that’s possible. Please try adding this to the “Custom Commands” text field on the “Edit” screen of the table:

    "columnDefs": [ { "render": function ( data, type, row, meta ) {
      if ( 'display' === type ) {
        data = '<a href="mailto:[email protected]?subject=' + row[0] + '">' + data + '</a>';
      }
      return data;
    }, "targets": [ 7 ] } ]

    Just change the email address from [email protected] to the correct one.
    The text of the link will be what’s currently in that cell. The produce reference will be appended as a parameter so that it will be prefilled in the “Subject” line of the email.

    Regards,
    Tobias

    Thread Starter ibottles2015

    (@ibottles2015)

    No it hasn’t worked

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    please make sure to copy the code here from the forums, and not maybe from the notification email that you might have received. It’s important that all quotation marks are correct and not written as &quot;.

    Regards,
    Tobias

    Thread Starter ibottles2015

    (@ibottles2015)

    Thank you, it has worked but is in the wrong column, how do i change which column it is in?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ah, my bad, I mis-counted. Please change the [ 7 ] in that last line of code to [ 8 ]. That’s the column number (but with counting starting with 0 for the first column).

    Regards,
    Tobias

    Thread Starter ibottles2015

    (@ibottles2015)

    Perfect, thank you so much.

    Final question…. how do I change the colour of the top row so that it isn’t blue?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    For the color question, please see the TablePress FAQ page: https://tablepress.org/faq/change-background-color-table-head-row/

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter ibottles2015

    (@ibottles2015)

    i will of course give you a 5 star review, I want to add this code to numerous tables but when I tried it wont work on another one??

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    which code? The “Custom Command” for the email link or the CSS code for the table head colors?

    The CSS code should actually work globally already, whereas you would have to adjust the “Custom Command” for the other tables, i.e. column numbers, etc.

    Regards,
    Tobias

    Thread Starter ibottles2015

    (@ibottles2015)

    Yes, i copied the code from the first table and changed the number to 9 for this table https://cjk585181093.wpcomstaging.com/product/pet-plastic-bottles/ but it hasnt worked

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    here, the number would also need to be 8! Remember, counting the columns starts with 0 for the first column, so the ninth column is indicated by an 8 in the code.

    Regards,
    Tobias

    Thread Starter ibottles2015

    (@ibottles2015)

    You Sir are a wonderful man, thank you

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, always happy to help! 🙂

    Best wishes,
    Tobias

    Thread Starter ibottles2015

    (@ibottles2015)

    Hi Tobias, is there a way to expand certain rows in a table? If you look at this page https://cjk585181093.wpcomstaging.com/1352-2/ some columns are too thin so cut off to much text

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    you’d need to manually set column widths here, for some other columns, by using “Custom CSS” like https://tablepress.org/faq/column-widths/

    In addition, I recommend to add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress,
    .tablepress * {
     word-break: normal;
     word-wrap: normal;
    }

    to override some Jetpack CSS code.

    After making changes to the CSS, you might then have to flush the cache of the Jetpack plugin, which you seem to be using to CSS minification and concatenation.

    Regards,
    Tobias

Viewing 15 replies - 1 through 15 (of 43 total)

The topic ‘email link in column’ is closed to new replies.