Forum
Prevent templated text block from outputting to page
Hello,
I have made a "Found Item" table as part of a Lost and Found page. I have used CSS display:none so that some information can be recorded and available to office staff but not output to the page. This works fine, but is there any way to do this with a Perch device? I see that type="hidden" does rather the opposite. Just curious.
<table>
<thead>
<tr>
<th>Date Found</th>
<th>Item/Description</th>
<th>Additional Information</th>
</tr>
</thead>
<tbody>
<perch:repeater id="founditems" label="List found items">
<tr>
<td><perch:content id="founddate" type="text" label="Enter date item was found." /></td>
<td><perch:content id="founddesc" type="text" label="Describe the found item." /></td>
<td><perch:content id="foundadd" type="text" label="Found item: additional information." /></td>
<td class="displaynone"><perch:content id="foundwhere" type="text" label="Where the item was found" help="This item is for office reference and will not print to the page." /></td>
<td class="displaynone"><perch:content id="finder" type="text" label="Person who turned in the item" help="This item is for office reference and will not print to the page." /></td>
<td class="displaynone"><perch:content id="foundnotes" type="text" label="Notable characteristics of the item" help="This item is for office reference and will not print to the page." /></td>
</tr>
</perch:repeater>
</tbody>
<tfoot></tfoot>
</table>
suppress="true"
https://docs.grabaperch.com/docs/templates/attributes/suppress/
Should anyone read this, I note that adding suppress="true" to the template does prevent the written content from outputting to the page. In this case, the tabledata <td> boxes (imagine they have borders) still output to the page.
While the display:none CSS solution prevents this, the simpler solution is to write the <perch:content ... /> template but eliminate opening and closing tags as, in my example, the <td> </td> tags.