hi
I have a page called "license" (and with a TitleLink called 'license').
I have another page called "theme".
I want to include licence page content in theme page.
I add this code in codeblock, but it doesn't work :
``
How should I do that ?
Is there a content macro to do that ?
my page was unpublished, so, I have to set 2nd parameter...
is there a macro do do that (insert page contents anywhere in another page content) ?
No, no macro for that exists currently. All can be done, could be part of Zenpage but will have to wait after 1.4.6. then. Or an independent plugin like this https://github.com/acrylian/zenpage_subpages.
You can enable the macro plugin to get a list of all available macros.
No, no macro for that exists currently. All can be done, could be part of Zenpage but will have to wait after 1.4.6. then. Or an independent plugin like this https://github.com/acrylian/zenpage_subpages.
Seems usefull so I might give it a shot the next days as an "half official" plugin.
Btw, you can enable the macro plugin to get a list of all available macros.
hi
I had a look on your plugin that add a content macro and I read content macro tutorial (http://www.zenphoto.org/news/content-macros).
I have questions about macro :
$plugin_is_filter = [b]9[/b]|THEME_PLUGIN|ADMIN_PLUGIN;, but in tutorial, $plugin_is_filter = [b]5[/b]|THEME_PLUGIN|ADMIN_PLUGIN; is mentioned : what is the difference between 5 an 9 (please, don't answer 4 :-) )this plugin doesn't work
`
The answer is of course 42 :-) Seriously that is the priority of the plugin load order.
From a quick look: Your plugin does not work because you have to define the actual funtion to return the content of the macro. Calling outside functions does not work because of the parameters.
But you don't need to bother, I have a plugin on my list for articles and pages content already so if you can wait 1-2 days.
of course, I can wait if somebody does the job for me ;-)
but, I would like to understand where is the matter...
in exempleMacro, there is CODEBLOCK macro which refer to outside function, and it works
[...] 'CODEBLOCK' => array( 'class' => 'procedure', 'params' => array('int'), 'value' => 'printCodeblock', 'owner' => 'exampleMacros', 'desc' => gettext('Places codeblock number [code]%1[/code] in the content where the macro exists.')), [...]
Right, indeed, my mistake looking to quickly at it. I cannot answer right now without looking more at it. The difference is the "procedure" vs "function" and "get" vs "print":
http://www.zenphoto.org/news/content-macros#standard-macros
this plugin works :
`
I cannot answer at the moment I mostly go this way, too. Could be the owner maybe. I always tend to use the object model instead of template functions. For extra content fields you even have to as you cannot call them directly otherwise, those my plugin was meant to support as well.
your plugin will be most robust and complete than mine.
but 2 questions :
1- what are the differences between procedure, function and expression ?
2- how avoid html error generated by tinyMCE ?
for the 2nd question, some explanation :
in tyneMCE, I added my macro like that [PAGE_CONTENT 'license' false].
tyneMCE automaticaly wrapped this text by html tag.
but as I insert my page content, it generate wrong html flow like
`
blabla
blabla
`
Mine is not that much different from yours, just a bit more complete:
https://github.com/acrylian/zenpage_content
Regarding the wrong html I fear there is no easy way to prevent that. When the macro is entered TinyMCE by default wrapps it with a paragraph as with all text you enter. It does not "know" that that also prints html on the front end. The only way would be to disable this behaviour but that causes other issues. Actually we then had to replace line breaks with paragraphs and such before outputting anything.
I am honest I cannot exactly explain the difference between procedure, function and expression types. For procedure and function it is probably that the first works with functions that print/echo something while the function one uses return values and prints them itself. The doc needs to be clearer with the actual differences.
ok
tkanks for the plugin (and the inspiration :-)
some comments about it :
according to me
$titlelink shouldn't have a default value $titlelink = '' (lines 31, 35, 38, 42)Indeed, the first should be and is technically as it does not make any sense to not set it ;-)
Those could be part of Zenpage but maybe it would make sense to keep them separate but collect in one. In any case for 1.4.6 we have feature freeze already.
Update: I have renamed the repo to "zenpage_macros" and will merge it to a plugin of the same name. I can later decide if this gets incorporated into Zenpage as well.
Update 2: I have now merged both and renamed the plugin. Please test so I have no type anywhere :-) https://github.com/acrylian/zenpage_macros
Latest news sounds like a good idea, although it will have the same issue with tinymce and paragraph wrappers.
I opened à ticket : https://github.com/acrylian/zenpage_macros/issues/1