Posts by Mark Fisher


    In a form template used by perch_blog_post_comment_form(), the following HTML works:

    1. <perch:input type="hidden" id="postID" value="<perch:blog id="postID" />" />

    This results in the following rendered HTML.

    1. <input id="form1_postID" name="postID" value="123" type="hidden">

    However the following, where " is replaced by ' instead of having double quotes nested inside each other, does not work. The value attribute is stripped, and so the comment is not entered in the database.

    1. <perch:input type="hidden" id="postID" value='<perch:blog id="postID" />' />

    This results in the following HTML.

    1. <input id="form1_postID" name="postID" value="" type="hidden">

    Is this expected behaviour or a bug? I have happily nested double quotes inside single quotes when not using forms, and not had problems.

    Almost. In fact we have reduced PERCH_UNDO_BUFFER to 1 in order to reduce the time taken by "OPTIMIZE TABLE PERCH_DB_PREFIX_content_index" when making changes.

    However it did come in pretty handy once when my boss unchecked the "Allow multiple items" checkbox instead of "Edit all one one page", thereby deleting all items but one unintentionally.

    Well if perch_template() is supposed to work with a one-dimensional array, then I'm reporting a bug. Though it is not a problem for me as I have discovered the workaround, I thought I'd report so that others don't spend time with the same issue.

    However, if perch_template() is not supposed to work with a one-dimensional array, then it's an issue with the docs for perch_template().

    I don't mind, but it seems to me like a bug as one-dimensional arrays work almost fine, apart from this one issue.

    Or maybe you're not misremembering and multiple levels of includes shouldn't work, in which case this seems like a pretty big omission in the docs for template includes. I have only ever used multiple levels of template includes when using the perch_template() function, and as I say it works with multi-dimensional arrays but not with one-dimensional arrays. As for what happens when not using perch_template(), I am not sure, though my guess is it would work, based on the fact perch_content_custom always returns a multi-dimensional array even if there is one item.


    The online documentation for perch_template() suggests that it should work when using one-dimensional arrays as the data.

    However I have found that when doing this, <perch:template> includes inside other <perch:template> includes do not work.

    See the example below.

    Code: a.html
    1. a<perch:template path="content/b.html"/>

    Code: b.html
    1. b<perch:template path="content/c.html"/>

    Code: c.html
    1. c

    Although it's simple enough to use multi-dimensional arrays all the time, it was not at all obvious how to fix the problem, and as I say, the documentation uses a one-dimensional array in the example.


    I have just noticed that the contents of <perch:help> in templates is not showing in the Blog addon. I imagine that this stopped working after our recent upgrade to Perch v3. Is this a bug, or is this no longer supported in the blog app?

    We are using Perch v3.1.3 and Perch Blog v5.6.1.

    <perch:help> is still showing for normal content.