radiant/radiant-search-extension

"exclude_pages" attribute doesn't work

RafaelMCarvalho opened this issue · 7 comments

Hello,

I saw at http://wiki.github.com/radiant/radiant/search-extension that I can use this form:

<div id="searchform">
  <r:search:form submit="Search" url="/search"  exclude_pages="/rss/,/styles.css/,/sitemap.xml/">
  <r:input value="search" accesskey="s"/>
  </r:search:form>
</div><!-- #searchform --></code>

but the attribute exclude_pages="/rss/,/styles.css/,/sitemap.xml/" doesn't work. I still founding rss, styles.css and sitemap.xml pages.

I looked at app/models/search_page.rb and there's nothing about "exclude_pages" attribute. Is this feature not implemented yet?
or am I missing in something?

Thanks!

I don't know who wrote that content in the Wiki, but it is inaccurate. You're right, there is no exclude_pages option. There does seem to be a branch which contains this http://github.com/radiant/radiant-search-extension/network

I'll work on pulling that in.

Yeah, I found it made by adamtanner:

http://github.com/adamtanner/radiant-search-extension

Thanks.

I added functionality as was originally intended in my fork http://github.com/velovint/radiant-search-extension

pulled in for now, but the sql should be optimized. Thanks!

do you mean logic below should be moved into actual SQL?
@query_result = pages.delete_if { |p| !p.published? || exclude_pages.include?(p.url)}