Forum OpenACS Q&A: Returning nothing from an included snippet

Greetings,

What's the best way to return nothing at all from an <include>d snippet of code?

I have a page that includes several blocks of html which are all generated by adp/tcl pairs.  Some of those blocks I would like to omit if there are no privileges on an underlying object.  I could just set a flag in the .tcl file and then in the .adp say something like:

<if @no_permissions@ true>
<!-- show nothing -->
</if>
<else>
show the snippet
</else>

but that seems kludgy.  Can I just "return" in the tcl file and have the adp generation get stopped?

Collapse
Posted by Jeff Davis on
You can use the <include-optional> tag Lars added (see lars-blogger/www/index.adp for an example).