I have a Metadata Multiple Text Field Format which when outputted on the front end looks like:
keyword1; keyword2; keyword3; etc; etc
I want to change how that is presented. Is it possible to modify the output of metadata keywords using a paintlayout?
Aleks
I think that field always prints its value like that, and there is no way to change it besides using JavaScript in the paint layout.
I need to do just this also. At first I thought a paint layout with javascript would be necessary. However, I noticed that the layout of the multiple text metadata on the backend is exactly what I need to display on the front end (i.e. the <ul><li> for each line). So now I wonder how did you guys display it on the backend? Is their javascript/php that I am just not seeing to put the tags between each line instead of the semicolon?
Yeah, I too would like the front end presentation of my select fields values to be an unordered list.
Does anyone have an example of this or know what to do?
I used the following code on a paint layout to separate out the tags and make them links to a search page for that term…
[codebox]
<script type="text/javascript">var str = "%asset_metadata_tags%";
str = str.split(";");
str.sort(); //sort alphabetically
var counter=0;
//Let's print out the elements of the array.
for (counter=0; counter<str.length; counter++)
document.write('<a href="/tags?queries_video_tag_query=' +str[counter]+ '">'+ str[counter] +'</a>, ');
</script>
[/codebox]
While Javascript is definitely not my strong point, the following edited script should do what you're looking for…
[codebox]
<ul>
<script type="text/javascript">var str = "%asset_metadata_tags%";
str = str.split(";");
str.sort(); //sort alphabetically
var counter=0;
//Let's print out the elements of the array.
for (counter=0; counter<str.length; counter++)
document.write('<li>' + str[counter] +'</li>');
</script>
</ul>
[/codebox]
I'm not aware of any way to do this with standard matrix functionality.
Works for me, thanks very much! 