Skip to content

Commit

Permalink
Add DC metadata to head.
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenyoung committed Jul 5, 2016
1 parent 887b909 commit 46add54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions components/com_jcar/site/views/item/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
*/
defined('_JEXEC') or die;

use \Joomla\Utilities\ArrayHelper;

JFactory::getDocument()
->setMetaData("DC.title", reset(ArrayHelper::getValue($this->item->metadata, "dc.title")))
->setMetaData("DC.author", reset(ArrayHelper::getValue($this->item->metadata, "dc.contributor.author")))
->setMetaData("DC.issued", reset(ArrayHelper::getValue($this->item->metadata, "dc.date.issued")))
->setMetaData("DC.publisher", reset(ArrayHelper::getValue($this->item->metadata, "dc.publisher")));

JLoader::register(
'JCarHelper',
JPATH_ROOT.'/administrator/components/com_jcar/helpers/jcar.php');
Expand Down
2 changes: 1 addition & 1 deletion components/com_jcar/site/views/item/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function display($tpl = null)
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->params = $this->state->get('params');

parent::display($tpl);
}
}

0 comments on commit 46add54

Please sign in to comment.