Search patch (global tags)

I have been following this guide to add search to radiant.

http://wiki.radiantcms.org/Using_the_Search_Extension

I would like to add search globally - not only on a specific search
page. And to do that I have to apply the “search_extension.diff” patch,
but when I run it it says:

[[email protected] radapp]$ patch -p0 < search_extension.diff
patching file vendor/extensions/search/test/unit/search_page_test.rb
patching file vendor/extensions/search/test/unit/search_tags_test.rb
patching file
vendor/extensions/search/test/functional/search_extension_test.rb
patching file vendor/extensions/search/test/fixtures/pages.yml
patching file vendor/extensions/search/test/fixtures/page_parts.yml
patching file vendor/extensions/search/app/models/search_page.rb
Hunk #2 succeeded at 72 (offset 8 lines).
patching file vendor/extensions/search/app/models/search_tags.rb
patching file vendor/extensions/search/search_extension.rb
Hunk #1 FAILED at 9.
1 out of 1 hunk FAILED – saving rejects to file
vendor/extensions/search/search_extension.rb.rej

I kind of hoped it did not matter, but when i add the search tag on a
page it displays:

undefined tag `search’

(I also ran “rake production db:migrate:extensions” after the patch was
applied)

Now suddenly it is even more broken - it now says:

undefined tag `form’

I then deleted the search extension folder.

Re-unpacked the tar.gz file - renamed the folder to search and ran rake,
but it still says:

undefined tag `form’

Jan frederik Poulsen wrote:

Now suddenly it is even more broken - it now says:

undefined tag `form’

I then deleted the search extension folder.

Re-unpacked the tar.gz file - renamed the folder to search and ran rake,
but it still says:

undefined tag `form’

Okay now the basic search is working again. It seems some time has to
pass before it kind of resets.

But I would still like global search and live search, what seems to be
the issue with the “search_extension.diff” patch?

Jan frederik Poulsen wrote:

Any help? I’m getting a bit desperate? :frowning:

The newest Search Extension code is in GitHub:
http://github.com/radiant/radiant-search-extension/tree/master

However, it removes the live search functionality. You might want to use
the download link and try it out anyways, because it should accomplish
your other goals.

  • Dave

Any help? I’m getting a bit desperate? :frowning:

David P. wrote:

Jan frederik Poulsen wrote:

Any help? I’m getting a bit desperate? :frowning:

The newest Search Extension code is in GitHub:
http://github.com/radiant/radiant-search-extension/tree/master

However, it removes the live search functionality. You might want to use
the download link and try it out anyways, because it should accomplish
your other goals.

  • Dave

Also, here are my notes on using an older version of the Search
Extension. This might be helpful to you.

$ cd PATH/TO/PROJECT
$ svn export
http://svn.radiantcms.org/radiant/tags/rel_0-6-6/extensions/search
vendor/extensions/search

Add a new tag to
/PATH/TO/PROJECT/vendor/extensions/search/app/models/search_page.rb

2008-05-21 DP added new tag to check if a search has been submitted

desc %{ Checks if a query was passed to the browser.}
tag ‘search:if_submitted’ do |tag|
unless @query == “”
tag.expand
end
end

Be sure to set the Page Type to “Search” or else loading the page will
fail with an error about a missing tag.

The following is a good default Search page…

<r:search:form label=“Search for:”/>

Searching '' returned no results.

Searching '' returned:


You can prevent pages from being returned by adding a ‘no-search’
page-part to them.

The above tag <r:unless_content part=“no-search”> is used to hide all
pages with a page-part of ‘no-search’ in the search results. This can
result in searches that return “Your search for ‘X’ returned the
following pages:” with no results below, but its better than showing
hidden pages.

  • Dave

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs