Forum: Radiant CMS Default snippets filter

Bd8002cba56274a8c85538e036ee54a3?d=identicon&s=25 Sam Whited (Guest)
on 2010-11-17 08:27
(Received via mailing list)
-----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 Whited
pub 2048R/0DBB515F

SamWhited.com
sam@samwhited.com

Georgia Institute of Technology
Mechanical Engineering Undergraduate
swhited@gatech.edu
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-----
09477c358c5897d44121a248326e16d7?d=identicon&s=25 Jim Gay (Guest)
on 2010-12-07 04:36
(Received via mailing list)
On Wed, Nov 17, 2010 at 2:26 AM, Sam Whited <sam@samwhited.com> 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
https://github.com/radiant/radiant/wiki/Additional...

In 0.9.0 look at
https://github.com/radiant/radiant/blob/0.9.0/app/...
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 https://github.com/radiant/radiant/issues
Bd8002cba56274a8c85538e036ee54a3?d=identicon&s=25 Sam Whited (Guest)
on 2010-12-07 07:24
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 12/6/2010 22:35, Jim Gay wrote:
>> A well-tested patch would be applied, for sure. Or, if you can't do
>> that, make an issue for it 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 Whited
pub 2048R/0DBB515F

SamWhited.com
sam@samwhited.com

Georgia Institute of Technology
Mechanical Engineering Undergraduate
swhited@gatech.edu
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-----
Bd8002cba56274a8c85538e036ee54a3?d=identicon&s=25 Sam Whited (Guest)
on 2010-12-07 07:26
(Received via mailing list)
Attachment: defaults_snippet_filter_config.diff (716 Bytes)
Attachment: defaults_snippet_filter_config.diff.sig (287 Bytes)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

On 12/7/2010 01:23, Sam Whited 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-----
09477c358c5897d44121a248326e16d7?d=identicon&s=25 Jim Gay (Guest)
on 2010-12-07 14:08
(Received via mailing list)
Sam,

Can you fork the project on github and send a pull request?
http://help.github.com/forking/
http://help.github.com/pull-requests/
Bd8002cba56274a8c85538e036ee54a3?d=identicon&s=25 Sam Whited (Guest)
on 2010-12-07 16:13
(Received via mailing list)
Done. See: 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 Gay <jim@saturnflyer.com> wrote:
>>
>> I'll forward this over to radiant-dev once I get a bit of feedback (I've
>>
> Jim Gay
> Saturn Flyer LLC
> http://www.saturnflyer.com
> 571-403-0338
>



--
Sam Whited
pub 2048R/0DBB515F
SamWhited.com
sam@samwhited.com
Georgia Institute of Technology
Mechanical Engineering Undergraduate
swhited@gatech.edu
404.492.6008
This topic is locked and can not be replied to.