The simpler media website CMS
I try to understand Zenphotos macros.
Following this page
https://www.zenphoto.org/news/content-macros/
I wrote a php macro file, enabled it in the extensions admin page.
I get a blank page because of line
'owner'=>'mymacro.php';
and with
'owner'=>'mymacro.php',
My Hello World is not displayed (using [ HELLOWORLD My ] )
End of page is not displayed too.
Using [ HELLOWORLD ] displays in red 1 parameter is missing, but page is fully displayed.
[ HELLOWORLD 'My' ] does not work too.
So, I am a bit lost.
Comments
Without the full code it will be hard to tell. What does the debuglog say? (that is the first you have to look!).
If you have the spaces before/after the brackets it is probably just that. Those are only there in the doc - as noted - to make sure ZP does not exectute them. So
[HELLOWORLD My]
.I referenced it on the other topic but this is a quite simple macro plugin you also can use as a guide:
https://github.com/acrylian/zp_mapembed
My php file is a copy of code found here :
https://www.zenphoto.org/news/content-macros/ :
And error log :
Your macros are ok :
work as expected
The code looks actually correct, althouth the macro class probably should be "function" instead of "expression".
Thanks you just found an error. There was a globla declaration missing. Should be fixed in the 1.6.4 support build. 1.6.4 will probably be release later today.