Actually I've managed to resolve this issue.  The extension uses the  
following code in the radius tag

     tag 'results:each' do |tag|
       tag.locals.results.collect do |result|
         tag.locals.page = result
         tag.expand
       end.join("\n")
     end

the variable tag.locals.page conflicts with the page object, so  
changing to tag.locals.foundpage solves the problem.

I also had to change the 'results:each:excerpt' to get the excerpt  
like this

tag.locals.results.excerpt_for(content, tag.locals.foundpage.class)

as excerpt_for needs to know what class it is working on.

Now all I need to do is write a custom link and title tag for the  
radius tags and I'm sorted.

John

On 30 Oct 2009, at 13:59, Josh French wrote:

>> This works fine as all the news gets indexed, however I'm struggling
>> to search the news article.  When I do a search terms that has
>> NewsArticles in it I get the following error message
>
> Hi John,
>
> The Sphinx Search extension was initially built to work with arbitrary
> models but the actual results page is a late addition and so may need
> some tweaking. Can you paste a little more of the stack trace where
> you're getting the "undefined method `request'" error? I suspect it's
> just that the results tags are expecting Page objects and your
> NewsArticle pages don't conform to some assumption. (I am assuming
> that NewsArticle is *not* a Page subclass -- is that correct?)
>
>> does it mean that the tags are being
>> indexed and as such and class or id attributes etc might appear
>
> I *think* the strip_html option operates before your content gets
> indexed, but you might want to verify that with the Sphinx folks.
>
>> One final question, there doesn't appear to be a link tag in the
>> extension's tag class.  Do I need to write my own 'link' tag to link
>> to the correct page?
>
> In your case, you'll need to because you have polymorphic results
> objects. There's no way of knowing if your models have methods like
> link, url, or slug, so I can't supply tags that automatically expose
> the proper links.
>
> In the simple case however -- a search that returns Page objects only
> -- within an r:results:each block you should be able to call any tag  
> that a Page responds to, like r:url or r:title.
>
> Josh
> _______________________________________________
> 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

Reply via email to