# Default snippets filter

**URL:** <https://www.ruby-forum.com/t/default-snippets-filter/199245>\
**Category:** Radiant CMS\
**Created:** [November 17, 2010, 8:27am UTC](https://www.ruby-forum.com/t/default-snippets-filter/199245 "2010-11-17T08:27:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 17, 2010, 8:27am UTC](https://www.ruby-forum.com/t/default-snippets-filter/199245/1 "2010-11-17T08:27:48Z")

</div>

-----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](http://SamWhited.com)  
removed\_email\_address@domain.invalid

Georgia Institute of Technology  
Mechanical Engineering Undergraduate  
removed\_email\_address@domain.invalid  
404.492.6008  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.10 (MingW32)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org/](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-----

---

<div class="post-metadata">

**Author:** ![sweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@sweb](https://www.ruby-forum.com/u/sweb)\
**Post date:** [December 7, 2010, 4:36am UTC](https://www.ruby-forum.com/t/default-snippets-filter/199245/2 "2010-12-07T04:36:27Z")

</div>

On Wed, Nov 17, 2010 at 2:26 AM, Sam W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

> **[Create new page · radiant/radiant Wiki](https://github.com/radiant/radiant/wiki/Additional-Configuration-Options)**
>
> Radiant is a no-fluff, open source content management system designed for small teams. - Create new page · radiant/radiant Wiki

In 0.9.0 look at

> <https://github.com/radiant/radiant/blob/0.9.0/app/models/page.rb#L228-234>

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](https://github.com/radiant/radiant/issues)

---

<div class="post-metadata">

**Author:** ![sweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@sweb](https://www.ruby-forum.com/u/sweb)\
**Post date:** [December 7, 2010, 7:24am UTC](https://www.ruby-forum.com/t/default-snippets-filter/199245/3 "2010-12-07T07:24:20Z")

</div>

-----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](https://github.com/radiant/radiant/issues)

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|blog](https://blog.samwhited.com/)**

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Georgia Institute of Technology  
Mechanical Engineering Undergraduate  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
404.492.6008

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.10 (MingW32)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org/](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-----

---

<div class="post-metadata">

**Author:** ![sweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@sweb](https://www.ruby-forum.com/u/sweb)\
**Post date:** [December 7, 2010, 7:26am UTC](https://www.ruby-forum.com/t/default-snippets-filter/199245/4 "2010-12-07T07:26:13Z")

</div>

-----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/](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-----

---

<div class="post-metadata">

**Author:** ![sweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@sweb](https://www.ruby-forum.com/u/sweb)\
**Post date:** [December 7, 2010, 2:08pm UTC](https://www.ruby-forum.com/t/default-snippets-filter/199245/5 "2010-12-07T14:08:33Z")

</div>

Sam,

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

> **[GitHub Support](https://support.github.com)**
>
> GitHub Support is here to help. Learn about GitHub products, browse our helpful resources, and contact support with your questions.

> **[GitHub Support](https://support.github.com)**
>
> GitHub Support is here to help. Learn about GitHub products, browse our helpful resources, and contact support with your questions.

---

<div class="post-metadata">

**Author:** ![sweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@sweb](https://www.ruby-forum.com/u/sweb)\
**Post date:** [December 7, 2010, 4:13pm UTC](https://www.ruby-forum.com/t/default-snippets-filter/199245/6 "2010-12-07T16:13:37Z")

</div>

Done. See: [Configuration option defaults.snippet.filter by SamWhited · Pull Request #174 · radiant/radiant · GitHub](https://github.com/radiant/radiant/pull/174)

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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://www.saturnflyer.com)  
> 571-403-0338

–  
Sam W.  
pub 2048R/0DBB515F

> **[SamWhited|blog](https://blog.samwhited.com/)**

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Georgia Institute of Technology  
Mechanical Engineering Undergraduate  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
404.492.6008
