Default snippets filter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Does anyone know if there is an option to set the default filter for
snippets in Radiant 0.9.0?

I’ve got my default pages filter set (‘defaults.page.filter’) so I
thought there might be a similar option for snippets
(‘defaults.snippets.filter’ or similar) but nothing I’ve tried has
worked, and I can find no information about it online.

Thanks,
Sam


Sam W.
pub 2048R/0DBB515F

SamWhited.com
[email protected]

Georgia Institute of Technology
Mechanical Engineering Undergraduate
[email protected]
404.492.6008
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJM44OuAAoJEHjfG+UNu1FfPkoH/3LVG+nXcjlfRiL6zGdSNzeV
5t02cnmCOTZ9rJGFX/lxWsY6oS2al+agUP3/pnjIByDb9aK/PeK6lQzKXLH9+qXw
1jkMiacy568sbdyZ6qKIU2h+KUCcNYQjVXxH4rssNoRsacsItwRKMFTOCHubpivo
nfSsJ6MSJu/WrjGMSYHIlWd2Mvo4CBHWopmjMHFpjDaN3mXQZ/t0tSSoYBDzLCdg
qMHLOcBLOb/F92FREZ+qa5VorMzaqHESrF/kln4TWIsY9/Oke+dSe5iz4F8in7XZ
u6wVzNI3z3Hpj1v1FLePASR2uX/I6U6bsAu+e70kMirYS0CIMBMYq2hRNGeNRhY=
=fI0+
-----END PGP SIGNATURE-----

On Wed, Nov 17, 2010 at 2:26 AM, Sam W. [email protected] wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Does anyone know if there is an option to set the default filter for
snippets in Radiant 0.9.0?

I’ve got my default pages filter set (‘defaults.page.filter’) so I
thought there might be a similar option for snippets
(‘defaults.snippets.filter’ or similar) but nothing I’ve tried has
worked, and I can find no information about it online.

If you want a quick solution, you can override the view for creating
snippets with an extension.

Radiant does not currently set a default filter for Snippets.
There are some details on the wiki about configuration

In 0.9.0 look at

That’s where it uses the Radiant::Config settings for the default page
part filter.

Snippets aren’t as complex as pages, though. This could be addressed
in the model with after_initialize or in the controller.

A well-tested patch would be applied, for sure. Or, if you can’t do
that, make an issue for it Issues · radiant/radiant · GitHub

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/6/2010 22:35, Jim G. wrote:

A well-tested patch would be applied, for sure. Or, if you can’t do
that, make an issue for it Issues · radiant/radiant · GitHub

How about something like this?
It appears to be working for me and is not causing any problems (it
shouldn’t, it’s a grand total of 3 lines of code). It simply adds the
‘defaults.snippet.filter’ option which works exactly the same as
‘defaults.page.filter’.

I’ll forward this over to radiant-dev once I get a bit of feedback (I’ve
never submitted a patch for Radiant before, so I’d like to read up on
all policies and procedures first and make sure I do the thing properly,
even for a patch as simple as this one).

Best,
Sam


Sam W.
pub 2048R/0DBB515F

SamWhited.com
[email protected]

Georgia Institute of Technology
Mechanical Engineering Undergraduate
[email protected]
404.492.6008

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJM/dLQAAoJEHjfG+UNu1Ff2IUH+wcwkIFEaXWeKvoS9vnZmv9l
n/x+jgwclhLq+KfYduSmZ0+4kSZ5NqeMM6OHbTYmm9yVouPIaDDbtRA5rKHk1jHM
Rnc4CbVHvjJNpsUFMkgFl4TXYN07oRou44/ishnAaPO5BT2sWoCBof84FJcB9+52
ZuanhHAZLi2M/aTvzCwywWPxozMHHT319trCBdudftJfSo9dZJb4cVxp/uAyT1Xa
rz2HBTo3WmZ9rfavnbfft7KmvWhfkAUL1gk4t86RS+JDxBdoBcfHHE2+xBHPuNLj
sknt0ZqGJJqpPRHzDgd3KqJtTpEjqMqBZGgSO4bhUUOzPellV4k6bzEzD1u2y2c=
=/Dez
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Darn, that’s embarrassing. Here’s the file.

On 12/7/2010 01:23, Sam W. wrote:

I’ll forward this over to radiant-dev once I get a bit of feedback (I’ve
never submitted a patch for Radiant before, so I’d like to read up on
all policies and procedures first and make sure I do the thing properly,
even for a patch as simple as this one).

Best,
Sam

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJM/dMlAAoJEHjfG+UNu1Ff9lsIAK7SK9u49fV5U58Qlf4ldFtr
1UPs/u8QO/4mNdfzZHftZRDhlg5G62v58asJpSJIPtV8ZcSpyNunxS12jKZwNyXy
ml8FK7UDDpCKvCK0p1KY0Ip6ztDEzAS/cMJhuTV+ny+5V9mwiWZtLjp/mY82I8pw
Qh0g5d25CHc5oGWt69MlOwwUUJadllbl4MDp5sNs2F4BcDx6ZyeAnvjUrnaLdfk0
x9x7brAr7APuFCRiaKxxqgYasUO5pJt847uO+2RGrjaU6YUrIdqFg/D4ZsINipaB
ef6s0Gh6nYf5QU9tR/UQrFiN1nYp/L4jPGkA7fVUBcuHCnioqCePPcZeOcsPjH8=
=iB5o
-----END PGP SIGNATURE-----

Sam,

Can you fork the project on github and send a pull request?

Done. See: Configuration option defaults.snippet.filter by SamWhited · Pull Request #174 · radiant/radiant · GitHub

Thanks again for your help and for pointing me in the right direction
Jim.

Best,
Sam

On Tue, Dec 7, 2010 at 08:07, Jim G. [email protected] wrote:

I’ll forward this over to radiant-dev once I get a bit of feedback (I’ve

Jim G.
Saturn Flyer LLC
http://www.saturnflyer.com
571-403-0338


Sam W.
pub 2048R/0DBB515F
SamWhited.com
[email protected]
Georgia Institute of Technology
Mechanical Engineering Undergraduate
[email protected]
404.492.6008