Hi Michael,
Your hyperlink question is a tough one! The standard export buttons just export the content. What do you want to be exported?
You can add your own custom buttons and add your own logic. This is documented here:
https://wpdataaccess.com/docs/documentation/data-publisher/custom-buttons/
Below is the code for the SQL button (part of the premium version). You could write something similar that fits your needs.
function export_publication_selection_to_sql(table_name, pub_id, wp_nonce, primary_key) {
// Get table data
table = jQuery('#' + table_name + pub_id ).DataTable();
rows = table.rows({selected:true});
if (table.rows({selected:true}).count()===0) {
rows = table.rows();
}
data = rows.data();
// Add key values to array
ids = [];
rows.every(function ( rowIdx, tableLoop, rowLoop ) {
ids.push(jQuery(this.node()).find('td').eq(jQuery(this.node()).find("td." + primary_key).prop("cellIndex")).text());
});
// Define target url and add arguments
url =
wpda_pluginvars.wpda_ajaxurl +
"?action=wpda_export&type=row&mysql_set=off&show_create=off&show_comments=off&format_type=sql" +
"&pub_id=" + pub_id +
"&table_names=" + table_name +
"&_wpnonce=" + wp_nonce;
// Add keys to url
for (i=0; i<ids.length; i++) {
for (var pk in primary_key) {
url += '&' + primary_key[pk] + '[' + i + ']=' + encodeURIComponent(ids[i]);
}
}
window.location.href = url;
}
Thanks,
Peter
Thanks Peter
I don’t know enough to code that but I’ll see what I can learn.
For the links, a standard link is
<a href="http://www.example.com">Link Text</a>
The export functions will output Link Text but I want to be able to output http://www.example.com
I’m thinking of a few workarounds and will update this thread for others to maybe benefit from in the future.
Michael
-
This reply was modified 4 years, 9 months ago by
michael3740.
-
This reply was modified 4 years, 9 months ago by
michael3740.
Hi Michael,
Is it be an option to show the link + the full URL? The user can still click on the link in the browser but the full link will be printed as well. You could use a dyanmic hyperlink to achieve that result (need to change the format of the column as well). See:
https://wpdataaccess.com/docs/documentation/data-explorer/dynamic-hyperlinks/
Best regards,
Peter