i have problem with wptables extension in wordpress that i can not make dynamic url cell acording to wptables documentation in wp tables website.
i review this link " https://wpdatatables.com/documentation/column-features/url-link-columns/ "
but in this website just describe about making url link just in one cell but i wanna make all the cells of column in database
could some one help me?
2
Answers
i use,
SELECT cols, CONCAT("http://URL/",COL_NAME,"||",COL_NAME) AS COL_NAME
FROM tb_name
According to the wpDataTables documentation, you can convert any column into a URL link column by setting the URL link attribute.
transform into link URLs.
placeholders like
{placeholder}
which will dynamically insert thevalue of the cell. For example, if your URLs differ by an
ID
or aslug
stored in each row, your URL template might look something likehttps://example.com/page/{column_id}
.{column_id}
with the actual placeholder that matches thecolumn data.
If you need to construct more complex URLs that involve multiple fields from the table, you might consider using Custom JavaScript. wpDataTables allows you to add Custom JS via the table settings
For example: