The right way to do this is via
render context.
I want my
layout snips to have access to snip context. That is, if "users/phobia" is the current snip, then layout snips should be able to pass that detail to macros (or perhaps the macro and filter APIs should provide access) so metadata (how many views, what labels are available) can be looked up for display.
Example uses:
- "post to weblog" link (with context) available only when current snip uses the {weblog} macro.
- contextual RSS servlet link also available only when suitable macro is used
- GeoURL badge added only when ICBM label is attached to current snip
- index of links (from {link} macro or trackback labels) listed in sidebar
It's possible this is already doable (maybe macros have access to Servlet API context and can discern from URL?) but I'm looking for a "clean" API or suggestions.