[Radiant] Can a tag determine the filter used by it's page part?
Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html ). So... is it possible? Thanks! -philip ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
Philip Hallstrom wrote: Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html). So... is it possible? Yes, it is. I just wrote this tag to try it out: tag 'local:myfilter' do |tag| part = tag.locals.page.parts.find_by_name('body') myfilter = part.filter_id "#{myfilter}" end Actually, since it's all Rails underneath, you can do a lot. Just take a look at the schema for the database. Of course, if you end up searching based on any of those fields, set an index :P Cheers, Mohit. 1/29/2009 | 4:42 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
Mohit Sindhwani wrote: Philip Hallstrom wrote: Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html). So... is it possible? Yes, it is. I just wrote this tag to try it out: tag 'local:myfilter' do |tag| part = tag.locals.page.parts.find_by_name('body') myfilter = part.filter_id "#{myfilter}" end On the other hand, I do not (yet) know how a tag could know which part includes it. :-S Anyone? Cheers, Mohit. 1/29/2009 | 4:46 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
Hate to say it, but this sounds like a problem at the user level, not the tag. If you don't want filters being applied to certain text, Textile has a tag that will prevent it. Markdown may have a similar feature. Sean Mohit Sindhwani wrote: Mohit Sindhwani wrote: Philip Hallstrom wrote: Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html). So... is it possible? Yes, it is. I just wrote this tag to try it out: tag 'local:myfilter' do |tag| part = tag.locals.page.parts.find_by_name('body') myfilter = part.filter_id "#{myfilter}" end On the other hand, I do not (yet) know how a tag could know which part includes it. :-S Anyone? Cheers, Mohit. 1/29/2009 | 4:46 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
Sean Cribbs wrote: Hate to say it, but this sounds like a problem at the user level, not the tag. If you don't want filters being applied to certain text, Textile has a tag that will prevent it. Markdown may have a similar feature. Hi Sean I think I see what you mean, but what if the case is that you generate a URL and would like to dump at or !link! depending on the filter? Cheers, Mohit. 1/29/2009 | 10:17 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
On Jan 29, 2009, at 12:47 AM, Mohit Sindhwani wrote: Mohit Sindhwani wrote: Philip Hallstrom wrote: Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html ). So... is it possible? Yes, it is. I just wrote this tag to try it out: tag 'local:myfilter' do |tag| part = tag.locals.page.parts.find_by_name('body') myfilter = part.filter_id "#{myfilter}" end On the other hand, I do not (yet) know how a tag could know which part includes it. :-S Yeah, that's where I got stuck too :/ ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
On Jan 29, 2009, at 5:22 AM, Sean Cribbs wrote: Hate to say it, but this sounds like a problem at the user level, not the tag. If you don't want filters being applied to certain text, Textile has a tag that will prevent it. Markdown may have a similar feature. Maybe. In my case I was looking at the syntax_highlighter extension[1]. When used with textile it doesn't do the right thing unless you add the tags around it. Which is very doable, but it would be cool if the ... tag itself could figure that out and do it itself. Simplest to just have that tag always output it I suppose. -philip [1] I like the extension, but not pygments... no reason other than I don't want to have to install python so I was going to convert it to coderay or ultraviolet. Sean Mohit Sindhwani wrote: Mohit Sindhwani wrote: Philip Hallstrom wrote: Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html ). So... is it possible? Yes, it is. I just wrote this tag to try it out: tag 'local:myfilter' do |tag| part = tag.locals.page.parts.find_by_name('body') myfilter = part.filter_id "#{myfilter}" end On the other hand, I do not (yet) know how a tag could know which part includes it. :-S Anyone? Cheers, Mohit. 1/29/2009 | 4:46 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
I abandoned using the syntax_highlighter extension long ago because the syntax gem is pretty much unmaintained. I like using Dan Webb's code_highlighter.js. I have some additional languages on my github, too: http://github.com/seancribbs/codehighlighter-languages Sean Philip Hallstrom wrote: On Jan 29, 2009, at 5:22 AM, Sean Cribbs wrote: Hate to say it, but this sounds like a problem at the user level, not the tag. If you don't want filters being applied to certain text, Textile has a tag that will prevent it. Markdown may have a similar feature. Maybe. In my case I was looking at the syntax_highlighter extension[1]. When used with textile it doesn't do the right thing unless you add the tags around it. Which is very doable, but it would be cool if the ... tag itself could figure that out and do it itself. Simplest to just have that tag always output it I suppose. -philip [1] I like the extension, but not pygments... no reason other than I don't want to have to install python so I was going to convert it to coderay or ultraviolet. Sean Mohit Sindhwani wrote: Mohit Sindhwani wrote: Philip Hallstrom wrote: Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html). So... is it possible? Yes, it is. I just wrote this tag to try it out: tag 'local:myfilter' do |tag| part = tag.locals.page.parts.find_by_name('body') myfilter = part.filter_id "#{myfilter}" end On the other hand, I do not (yet) know how a tag could know which part includes it. :-S Anyone? Cheers, Mohit. 1/29/2009 | 4:46 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Can a tag determine the filter used by it's page part?
Philip Hallstrom wrote: On Jan 29, 2009, at 5:22 AM, Sean Cribbs wrote: Hate to say it, but this sounds like a problem at the user level, not the tag. If you don't want filters being applied to certain text, Textile has a tag that will prevent it. Markdown may have a similar feature. Maybe. In my case I was looking at the syntax_highlighter extension[1]. When used with textile it doesn't do the right thing unless you add the tags around it. Which is very doable, but it would be cool if the ... tag itself could figure that out and do it itself. Simplest to just have that tag always output it I suppose. -philip [1] I like the extension, but not pygments... no reason other than I don't want to have to install python so I was going to convert it to coderay or ultraviolet. Sean Mohit Sindhwani wrote: Mohit Sindhwani wrote: Philip Hallstrom wrote: Hi everyone - Working on an extension and it would be convenient for me if the tag could determine what if any filter was being applied to it's result. I didn't see anything in the source (but also haven't mapped it all the way through). I saw one post on the mailing list from a year ago asking this, but didn't see any replies (http://lists.radiantcms.org/pipermail/radiant/2007-May/004915.html). So... is it possible? Yes, it is. I just wrote this tag to try it out: tag 'local:myfilter' do |tag| part = tag.locals.page.parts.find_by_name('body') myfilter = part.filter_id "#{myfilter}" end On the other hand, I do not (yet) know how a tag could know which part includes it. :-S Anyone? Anyway, now that the question has come up, is there a way for a tag to know which page part is being rendered when it is called? Cheers, Mohit. 1/30/2009 | 2:05 AM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant