Forums » Metadata in head

RSS feed for this topic

Info

  1. How could I insert the DC metada or the dcmes-xml file in the header of the item. Thank you!

    Example:
    <head>
    <meta name="DC.title" content="Blade Runner "/>
    <meta name="DC.creator" content="Ridley Scott"/>

  2. You could make a conditional statement and use item metadata values only for item show pages.

    <!-- Meta -->
    <?php if ($bodyid=='items'&& $bodyclass=='show'):?>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="<?php echo item('Dublin Core', 'Creator'); ?>" content="<?php echo item('Dublin Core', 'Title'); ?>" />
    <?php else:?>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="<?php echo settings('description'); ?>" />
    <?php endif;?>

    But be sure that your items show page has the right body id and class in the head or you will get errors.

  3. It works! Thank you!

    I had to add to mytheme/items/show.php in 1st line:

    <?php head(array('title' => item('Dublin Core', 'Title'),'bodyid'=>'items','bodyclass'=>'show')); ?>

Reply

You must log in to post.