Support » Plugins » [Plugin: WP-Table Reloaded] How to import a table with links

  • Resolved OtaQ

    (@otaq)


    Please help me – I got a table with many lines and rows and I just would like to write Links via OpenOffice and .csv – then import it. And overwrite the table if I got new updates… (before you tell me, I donΒ΄t want to use the “add link” option in the frontend, cause the table is really big.

    My Problem: If I write the ta like

    <a href="http://the.link.com">The Link no 1</a>

    I always get a

    <a href=http://the.link.com>The Link no 1</a>

    imported… πŸ™

    ..so please tell me, how can I write the links in openoffice (or Save the file) to get this working???

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    this is coming from non-stanard CSV files (well, unfortunately there is no real standard…).
    In WP-Table Reloaded, I use the most common notation of “” for quotation marks. That is, because single quotation marks ” are already used for escaping cell values that contain quotation marks. (see the 4th example here: http://en.wikipedia.org/wiki/Comma-separated_values#Basic_rules)

    This means: If you write your l`inks as

    <a href=""http://the.link.com"">The Link no 1</a>

    in the CSV file, you will get

    <a href="http://the.link.com">The Link no 1</a>

    in the table.

    I’m not sure how you can change that behavior in OpenOffice, so the best way to get this might be to open the CSV file in a text editor and do a search and replace there, e.g. replace href=" with href="" and "> with "">.

    Best wishes,
    Tobias

    Thanks, this a idea – you must understand, I got a really big Table – So changing the links by hand in the frontend, is not possible – I will try it with the Editor.

    One question more: The sorting A-Z is of course a problem in the row with the Links, cause if you want to sort really by A-Z, all lines have to Links or else it will sort with “<href”-“Z” πŸ˜‰ – But there could be a possibility to get around this problem – Could you maybe make a possibility in one of your next updates, to ignore the URL while sorting? πŸ˜‰

    Hi,

    which sorting mechanism are you talking about, here? The one on the “Edit” screen or the JavaScript sorting, when viewing the table on a page?

    Regards,
    Tobias

    Oh sorry, I mean viewing the table on a page.

    And then, you can sort the table by A-Z.

    If you got a Link in the table, it always the first in line, because “<a href…” is of course before “A”, “B”, and “C” πŸ™‚

    My problem is, I would like to have some words in the table linked, and some not – but sorting should work for the words normally. LetΒ΄s say, I want to sort the real words, and not the code πŸ˜‰

    EDIT: Btw – You doing a GREAT WORK!!! I thank you very much and your work will a important part of my new website – IΒ΄ll definitely donate you something and thank you in the imprint πŸ˜‰

    Hi,

    good news, I believe that this is actually already possible πŸ™‚ You should only need to tell the DataTables JavaScript library (which performs the sorting) to use the values of included HTML (and not the entire HTML string).

    Please try this: Go the “Edit” screen of your table and look for the “Custom Commands” textfield in the “DataTables JavaScript Features” section. There, enter this code:

    "aoColumnDefs": [ { "sType": "html", "aTargets": [ 0 ] } ]

    Just one small change is required: Replace the 0 with the index of the column that you have your links in, minus 1.
    So, if all your links are in (for example) the third column, you would replace the 0 with a 2 (it is a zero based column index).

    This should tell DataTables to sort that column as “HTML”, which should exactly be what you would like to have.

    And thanks for your nice words πŸ™‚ That’s great to hear!

    Best wishes,
    Tobias

    Wow! Thank you so much… πŸ˜€

    Hi,

    no problem, you are very welcome!

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP-Table Reloaded] How to import a table with links’ is closed to new replies.