ZenphotoCMS Forum
how to use macro ? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: how to use macro ? (/thread-11087.html)



how to use macro ? - vincent3569 - 2013-05-29

hi

I am not sure to understand well how works Content macros http://www.zenphoto.org/news/content-macros.

in a page, I added some content in Codeblocks 3.
in my page content, I added [CODEBLOCK 3] somewhere.
but in my FE, I have the following message :
[CODEBLOCK 3] should have 1 parameter.

so, is it a bug or how to use this macro ?




how to use macro ? - acrylian - 2013-05-29

That is actually the right usage. Best you open a ticket so we can try to reproduce it later.




how to use macro ? - sbillard - 2013-05-30

I did discover that TinyMCE inserts ascii "non-breaking" spaces if you type more than one space in a row. The current DEV branch will now treat these as white space. I suspect that is the problem you were seeing.




how to use macro ? - vincent3569 - 2013-05-30

I checked html code of my content.
in fact, there was a introduce by a copy/paste from the zenphoto news.

After purge of html code, it works fine.

macro will certainly be useful, but we will have to be careful with the html code generated by TinyMCE, and it may be a point to be specified in the user guide...




how to use macro ? - acrylian - 2013-05-30

Hm, I did not notice the non breaking white spaces in my tests. But copy&paste can lead to some issues in TinyMCE. For example if you copy text from a website Safari somehow carries some safari specific inline styles with it sometimes that leads to unexpected layout changes.




how to use macro ? - vincent3569 - 2013-05-30

in the same way, what should be the album name for [SLIDESHOW %1 %2] macro ?

I set [CODEBLOCK 'images/photos-du-mois' true], as explain in admin/macro, in a content block, and I obtain this error in my page :
[CODEBLOCK 'images/photos-du-mois' true] should have 1 parameter.




how to use macro ? - acrylian - 2013-05-30

[CODEBLOCK 'images/photos-du-mois' true] of course does not work as the codeblock macro has only one parameter, that for the the codeblock to get.

[SLIDESHOW images/photos-du-mois true] is the usage for the slideshow. No quotes and no spaces for the parameters itself (other wise it would be noted as "%1" "%2").




how to use macro ? - vincent3569 - 2013-05-30

ooops! of course, I would use slideshow macro...
however, [SLIDESHOW images/photos-du-mois true] doesn't work, and break html flow.

I will create a ticket.




how to use macro ? - acrylian - 2013-05-30

You did enable the JS on the page you are using the macro? Without that it does break the layout. Also you theme might need to have the slideshow css included as well. Both is noted within the slideshow plugin file comments.




how to use macro ? - vincent3569 - 2013-05-30

see the ticket, to avoid multiple conversations on same subject
https://github.com/zenphoto/zenphoto/issues/406




how to use macro ? - sbillard - 2013-05-30

I will add a strip_tags to the parameter parsing to take care of TinyMCE inserting HTML markup.




how to use macro ? - sbillard - 2013-05-30

I also guess that the Slideshow macro needs to be improved since maybe images and albums would have spaces in their names.