"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.
exclude_pages in wiki goes from here http://groups.google.com/group/radiantcms-dev/browse_thread/thread/6a73bba7b7d03933/bf0ab45024bdd80c?lnk=gst&q=ajax+search#bf0ab45024bdd80c
I'm currently resurrecting it.
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)}
yes