I am creating a couple of snippets and would like them to share a default set of properties. Is this possible? I created a custom property set, but then you have to put that in the snippet call.
Maybe I’m just missing something here, working on stuff at 2 am is getting harder to do as I get older.
Using a custom property set would be the normal way of doing it, but you could grab either the default properties of another snippet or the custom property set in the snippet code with
<?php
$object = $modx->getObject('modSnippet',$id); // to get default props of the other snippet
//or
$object = $modx->getObject('modPropertySet',$id); // to get the custom property set
// then get the properties with
$props = $object->getProperties();
// and then merge them with the $scriptProperties array.
?>
That way you wouldn’t need to specify them in the snippet tag.
Bob, thanks for the tip. I hadn’t thought about doing it in the snippet code.