Setting up custom fields worked well, but I have trouble posting the content in pages.
When I try to get the custom field value example - pasting this code in the source (using TinyMCE):
Code: Select all
<?php
if ($page->custom('inStock')) {
echo "There is stock!";
} else {
echo "No more products";
}
?>
Code: Select all
<!--?php
if ($page->custom('inStock')) {
echo "There is stock!";
} else {
echo "No more products";
}
?-->
Code: Select all
protect: [
/\<\/?(if|endif)\>/g, // Protect <if> & </endif>
/\<xsl\:[^>]+\>/g, // Protect <xsl:...>
/<\?php.*?\?>/g
],