how to use macro ?

vincent3569 Member, Translator
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 ?

Comments

  • acrylian Administrator, Developer
    That is actually the right usage. Best you open a ticket so we can try to reproduce it later.
  • 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.
  • vincent3569 Member, Translator
    I checked html code of my content.
    in fact, there was a <span></span> 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...
  • acrylian Administrator, Developer
    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.
  • vincent3569 Member, Translator
    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.`
  • acrylian Administrator, Developer
    `[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").
  • vincent3569 Member, Translator
    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.
  • acrylian Administrator, Developer
    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.
  • vincent3569 Member, Translator
    see the ticket, to avoid multiple conversations on same subject
    https://github.com/zenphoto/zenphoto/issues/406
  • I will add a strip_tags to the parameter parsing to take care of TinyMCE inserting HTML markup.
  • I also guess that the Slideshow macro needs to be improved since maybe images and albums would have spaces in their names.
Sign In or Register to comment.