Hi @mateus.m.luna!
I would like to create a field on the item page where I can add a link to an external page. This link would correspond to another metadata field.
For example, my items are student projects from different study programmes (CyberAstrologie – Fusion aus Klassiker und Technologie – search). For each metadata field representing a study programme, I would like to have a different link to that programme’s page on the university website.
I tried doing this using the metadata type URL, but I couldn’t make it variable. The only solution I found was to create as many metadata fields as there are study programmes and then populate only the one assigned to that specific programme with the corresponding value.
I also noticed that Tainacan sanitises the text in text/text area metadata fields.
-
Is there any way to create a URL metadata field that can be variable depending on another metadata field?
-
Is there any way to insert a hyperlink into a text/text area metadata field?
Thank you very much for your help!
Daniel
You can add a plain URL than the link will be clickable. But you wont be able to put an html code, that will be stripped for security reasons. That is kinda the point of the URL metadata field existing. With it you can add a link and a label. If you go to its options, you could even use the “Link as a button” option. The you would need to use Markdown link notation (for example, [My label](https://my-link.com)).
But I’m failing to see how would the Text or Textarea filed suit you in a way that URL does not… What does Text type does for you that URL does not?
Now, when you talk about “Variable metadata”. Tainacan does not have a sort of “conditional metadata”, where one metadata is loaded or not in the form based on another metadata. That level of ganularity we won’t offer. But you can achieve this in a similar way with Conditional Metadata Sections:
On the other hand, if it is just a matter o grouping different sets of values maybe compound metadata can help? I don’t know it depends on your data. I’ll just remember that empty values may seem akward in the item form but in the public page they won’t even appear so you may create fields for dedicated areas and leave them empty if not desired.
1 curtida
Dear @mateus.m.luna,
Thank you very much for your quick reply!
I have to admit that I didn’t do enough research before asking. I managed to solve it with conditional sections. Fantastic!
Best,
Daniel