I have items with a linked field (to another Omeka resource). It is the dcterms:creator field which is a link to s Omeka’s item of class “Person”.
I would like to display the creator after the title in the browse pages. What I call “browse page” is page presenting all the items of an item-set (item-set/6723 in the URL).
I did the modification in the theme files but, of course, Omeka S displays the url pointing to the person page instead of the title of this item (which is the name of the person).
Here is what I added in the browse.phtml of my theme:
I think MetadataBrowse has a different purpose. I use it to see all items corresponding to a value. MetadataBrowse works only for page presenting one item (show) (correct me if I am wrong).
I try to display more information in multi-items pages (item-set or “browse” pages). I can add all field except the linked one.
In my website, I have a menu button pointing to a collection of articles. I have 50 titles of articles in a list and I would like to add the author. But it is a linked field and I can only print the URL.
So, it sounds like Metadata browse should apply to more pages. That’s something we can look into, though it makes the configuration a bit more complicated.
When values are resources, they are instance of ValueRepresentation. You can get the ResourceRepresentation (e.g. ItemRepresentation) using ValueRepresentation::valueResource() and then get the title using AbstractResourceEntityRepresentation::displayTitle()
The following code manage both cases: the value sometimes is a resource or a string.
Ensure the previous instruction has a final semi-colon ;
Or give me the part of your code containing the use instruction, it seems to be a simple local syntax error.
Otherwise, you can remove the use instruction and replace ValueRepresentation (after instance of) with \Omeka\Api\Representation\ValueRepresentation