Last active
August 29, 2015 14:21
-
-
Save heyjoecampbell/d62f6ccc019c07284a88 to your computer and use it in GitHub Desktop.
Use Joomla K2 ExtraFields for Meta Data (Replace Single & Double Quotes with HTML Entity)
This file contains 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
// remove single and double quotes - place at top of item override file | |
<?php | |
$safe = array("'", """); | |
$nonsafe = array("'", "\""); | |
?> | |
// code to generate meta data (change ExtrafieldAlias) - place after above code | |
<?php $doc->addCustomTag('<meta property="anything" content="'.str_replace($nonsafe, $safe, $this->item->extraFields->ExtrafieldAlias->value).'" />'); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by @kricore
https://gist.github.com/kricore/7abc76e04c1bc9235ce2