I'm trying to decide which is the easiest way to do this.
URL is represented in my Item Type metadata as a clickable hotlink. Ideally, I would like the URL field to sit at the top of the record right under title. So, mixing DC and item metadata.
Do I need to create a custom metadata file for my theme and code each DC field separately? Would I do the same for item metadata?
Is there an easier way?
I have a sense that this will move into more nuanced possibilities, but so far here's what I see as the most straightforward approach.
First, override the default
record-metadata.php file in your theme.
Then, you can add the following code to it. Note explanatory guides below!
</div><!-- end element -->
<?php if ( ($setName == 'Dublin Core') && ($elementName == 'Title')): ?>
<?php $urlText = metadata('item', array('Item Type Metadata', 'URL')); ?>
<div class="element-text"><?php echo $urlText; ?></div>
<?php endif; ?>
<?php endforeach; ?>
The first and last lines in the snippet above are already in the default
record-metadata.php file -- included them here to guide where to insert new code. The new code checks if it has just printed the title and, if so, also prints the URL from Item Type Metadata. In the Item Type Metadata section of the page, this will be duplicated, but a similar check could be done if you don't want that.
If there are more variations, yeah, that might move us closer to coding each metadata element separately, but I'm hoping to avoid that!
awesome. I will give this a try. For now, I just want to move the URL field, but yeah, I could see as a future enhancement, a custom display. (I have a lot of content to load and the deadline is getting shorter, so I'm putting together an "enhancements" list for next steps.)