I have a column with a Data Column Type of URL Link and Editor Input Type of Attachment. Is there a way to get the text on the URL link to show different text based on the file type. For example if the file type is a MP4 then show Video or if it's a PDF then show Document.
I tried using Conditional Formatting and it works but it removes the URL link.
If you mean to use our URL Link Column type - sorry to disappoint you, but there is no way to show the 'link displayed text' different for different rows in that column type.
In the URL Link Column, the only built-in easy option you have to set the displayed hyperlink text is if you activate 'show as a button' in the Data settings, then set a custom button label.
With this column Type (URL link), if you set that - it is going to show the same button displayed text for hyperlinks in each row - we don't have a way to set different one in each row.
The only current way is to manually write custom HTML in each row, if you use a String type column and we do not currently have a conditional logic available as you need it, like you described 'if the file extention is MP4, then set 'displayed link text' to 'video' or if PDF, set it as 'document'.
The only current way is completely manual like this in a String column :
1. First you would use attachment editor type to upload the files.
2. Then you would change the editor type of the String column.
3. Edit each cell and wrap it in custom HTML a href with optional 'target blank' to open in a new tab;
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
If you have coding skills and wish to try to make a custom solution now,
I have a column with a Data Column Type of URL Link and Editor Input Type of Attachment. Is there a way to get the text on the URL link to show different text based on the file type. For example if the file type is a MP4 then show Video or if it's a PDF then show Document.
I tried using Conditional Formatting and it works but it removes the URL link.
Thanks
Hi tnconnect,
If you mean to use our URL Link Column type - sorry to disappoint you, but there is no way to show the 'link displayed text' different for different rows in that column type.
In the URL Link Column, the only built-in easy option you have to set the displayed hyperlink text is if you activate 'show as a button' in the Data settings, then set a custom button label.
With this column Type (URL link), if you set that - it is going to show the same button displayed text for hyperlinks in each row - we don't have a way to set different one in each row.
The only current way is to manually write custom HTML in each row, if you use a String type column and we do not currently have a conditional logic available as you need it, like you described 'if the file extention is MP4, then set 'displayed link text' to 'video' or if PDF, set it as 'document'.
The only current way is completely manual like this in a String column :
1. First you would use attachment editor type to upload the files.
2. Then you would change the editor type of the String column.
3. Edit each cell and wrap it in custom HTML a href with optional 'target blank' to open in a new tab;
and then something like this :
That would be if it's a PDF, to say "document" in the hyperlink display text.
Then in another cell if a Video is uploaded, you would do the same method, just write "Video" in the hyperlink display text part, and so on...
For the time being this is the only way - since we don't have such advanced conditional logic as needed for your use-case.
You can suggest a built-in solution to our developers, though - they will do their best to make a solution in the future.
Please feel free to search on our suggestions page,
to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there, and as more people vote, the feature will move higher on the priority list.
You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;
and our newsletter, so you're informed about new features, bug fixes, freebies, etc.
If you have coding skills and wish to try to make a custom solution now,
you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.
We also added this new developer's handbook, which can allow users with coding skills to make custom add-ons.
Our developers will keep adding more custom hooks/examples there over time.
Please be advised that custom solutions with hooks are not included in our support.
You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.
( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables