[Radiant] snippet with params

35 views
Skip to first unread message

dave4c03

unread,
Sep 20, 2009, 5:43:27 PM9/20/09
to rad...@radiantcms.org
I can embed variable data into a snippet by referencing a page part.
However, this does not work well when you call the snippet multiple times
per page and the parameters vary with each call.

I think I need a snippet with parameters.
I see several possible approaches to doing this. It appears there are a
couple of extensions available to do this and I would expect it cold be done
by creating a radius tag for the purpose instead of using a snippet.
However, I have no idea of how to proceed.

Is there a "best practice" for this?
_______________________________________________
Radiant mailing list
Post: Rad...@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant

Chris Parrish

unread,
Sep 21, 2009, 2:31:48 PM9/21/09
to rad...@radiantcms.org
There are two extensions that I know of.

The first is Manuel Meurer's Parameterized Snippets Extension:
http://github.com/manuelmeurer/radiant-parameterized-snippets-extension

Manuel's extension was designed to do exactly what you are asking.


The other solution combination of two extensions that I created -
Variables, and Conditional Tags:
http://github.com/SwankInnovations/radiant-conditional-tags-extension
http://github.com/SwankInnovations/radiant-variables-extension

This is a bit more generic approach. The Variables extension lets you
declare variables for use within a page or pass variables to page parts
and/or snippets (parameters essentially). The Conditional Tags
extension, then allows you to use these variables and perform
conditional evaluations on them. Of course the Conditional Tags aren't
limited to your variables -- you can also use them with page properties
or even build your own evaluators. So it's more of a wider net approach.

Both solutions haven't been updated in some time and may have issues
with the new version of radius tags but probably not. I plan on looking
into updating my extensions here soon.

-Chris

Anton Aylward

unread,
Sep 16, 2015, 8:39:03 AM9/16/15
to Radiant CMS, rad...@radiantcms.org, chris.parri...@swankinnovations.com
Two questions:

1. Should this work with Radiant 1.x?

2. Are there some better examples of both the caller and the snippet?
Reply all
Reply to author
Forward
0 new messages