Created
October 23, 2012 19:48
-
-
Save jeremyboggs/3941122 to your computer and use it in GitHub Desktop.
Changes different heads for various DC fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="element-set"> | |
<h2><?php echo html_escape(__($setName)); ?></h2> | |
<?php foreach ($elementsInSet as $info): | |
$elementName = $info['elementName']; | |
if ($setName == 'Dublin Core') { | |
switch($elementName) { | |
// Check if $elementName is 'Description' | |
case 'Description': | |
$elementName = 'Header'; // Change value of $elementName to 'Header' | |
break; | |
// Check if $elementName is 'Relation' | |
case 'Relation': | |
$elementName = 'Further Reading'; // Change value to 'Further Reading' | |
break; | |
// Check if $elementName is 'Text' | |
case 'Text': | |
$elementName = 'Further Reading'; | |
break; | |
// Leave the default for headings you don't want to change. | |
default: | |
$elementName = $elementName; | |
} | |
} | |
$elementRecord = $info['element']; | |
if ($info['isShowable']): ?> | |
<div id="<?php echo text_to_id(html_escape("$setName $elementName")); ?>" class="element"> | |
<h3><?php echo html_escape(__($elementName)); ?></h3> | |
<?php if ($info['isEmpty']): ?> | |
<div class="element-text-empty"><?php echo __($info['emptyText']); ?></div> | |
<?php else: ?> | |
<?php | |
// We need to extract the element set name from the record b/c | |
// $setName contains the 'pretty' version of it that may be named differently | |
// than the actual element set. | |
?> | |
<?php foreach ($info['texts'] as $text): ?> | |
<div class="element-text"><?php echo $text; ?></div> | |
<?php endforeach; ?> | |
<?php endif; ?> | |
</div><!-- end element --> | |
<?php endif; ?> | |
<?php endforeach; ?> | |
</div><!-- end element-set --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment