View/popover view of table-view render

View/popover view of table-view render

koniahinkoniahin Posts: 186Questions: 39Answers: 7

For galleries I set up a shortcode function. In table view it list the function, filename, limit,roworder, and many other fiends. I am displaying that with render. This works fine, however there are many fields in the shortcode pipe-delimited list:

{{ shortcode | filename | limit | roworder | etc | etc | etc | ... }}

This works fine but really pushes pushes the reasonable limits of the table width with 8-10 columns in the view. I'm looking for an alternative to help keep this under control. Occasionally I see code/programming websites that discuss/show some code then give a copy option to copy the code.

Is this doable with render? Rather than displaying the full shortcode to the screen you display something like "Copy shortcode"?

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    I'm not clear on how your question relates to DataTables other than that you have a shortcode that creates a DataTable.

    If the shortcode is the limitation, you'd need to work with whatever platform you are using the shortcode on (WordPress?).

    Allan

  • koniahinkoniahin Posts: 186Questions: 39Answers: 7

    Take a look at the table view below:

    Although I can squeeze the full text of the column into the view, it really pushes the limits of the viewability of the page. I'd like to find if there is a way to use render to change what displays to something like 'copy shortcode', clicking on it would copy the text, shortcode, and you could paste it elsewhere.

    Occasionally, if not careful, when you copy the text, you end up copying the table cell style with the code.

    I'm not sure but I might have gotten the word shortcode from either Joomla or Wordpress both of which I jettisoned to the deep long ago.

  • kthorngrenkthorngren Posts: 21,322Questions: 26Answers: 4,948
    edited July 2023

    One option might be to use the Ellipsis renderer.

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You could also try something like this here. This is displaying truncated text (like your shortcode), but then clicking on a button copies the full text. The columns.render has access to the full row's data, so you can copy all the row data if that's preferred.

    Colin

Sign In or Register to comment.