Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: rah_file_search
Offline
Re: rah_file_search
ax wrote:
I will then instruct the readers of my page to modify the URL to display the result, accordingly -:)
If things are working properly, readers should not need to manually modify the url to display search results.
It should happen automagically :)
edit: just to make sure – the if_search section of your page template is set up correctly?
Last edited by maverick (2011-02-23 15:01:13)
Offline
#18 2011-02-23 15:28:40
- ax
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 166
Re: rah_file_search
maverick wrote:
It should happen automagically :)
Yes, but only if you specify the section in the search tag like this <txp:search_input section="References">. Otherwise, you get a list of articles and then you have to tinker with the URL, as Gocum suggested, to display the file list. I prefer the first method :))
Offline
#19 2011-02-23 16:47:02
- ax
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 166
Re: rah_file_search
Gocom wrote:
Released version 0.3. Changelog:
- Now populates search_result_count.
I do not have much knowlege of SQL, but I vaguely remember that there is a difference between NULL and zero. This might explain that in case of no articles found I get “Articles found”, but not “0 Articles found”, as expected. Unfortunately, “Articles found” is somewhat misleading when there are no articles found, therefore I would ask for a tiny little upgrade, e.g. to V. 0.3a, to include the “0”. But I cannot exclude that it is the fault of my Textpattern installation. In this case, please ignore this message.
Offline
Offline
Re: rah_file_search
Released version 0.4 of rah_file_search. Changelog:
- Added:
grand_totalattribute. Gives an option to omit updation of search_result_count. Allows<txp:article />tags to take care of the counting. - Changed: defaults search_result_count to 0 (zero).
Offline
Re: rah_file_search
Out of curiosity – is there a delay before updates show in rah_plugin_installer?
v0.3 showed up fine earlier today; v0.4 didn’t – even after hitting the check for updates a couple of times.
Not an issue – I just updated using c/p. But made me curious. :)
Offline
Re: rah_file_search
ax wrote:
Yes, but only if you specify the section in the search tag like this
<txp:search_input section="References">. Otherwise, you get a list of articles and then you have to tinker with the URL, as Gocum suggested, to display the file list. I prefer the first method :))
I have it on the default section of a site, and it searches all files, without the section being set, and returns (only) a list of download links. I’m using the example in the docs.
I haven’t tried it in other contexts (in a section for example), so perhaps that’s the issue?
My stumbling block is that it appears to search the actual file name only and not the the title or categories. Plus it doesn’t seem to work with wet_haystack.
Most of the site’s files are multiple words separated by underscores.
For example, the file name is practice_test. As long as you input practice, or test, or “practice_test”, you get the right results.
But if you type in “Practice Test” you’re out of luck.
fwiw
Offline
Re: rah_file_search
maverick wrote:
I have it on the default section of a site, and it searches all files, without the section being set, and returns (only) a list of download links. I’m using the example in the docs.
As it’s supposed to do.
I haven’t tried it in other contexts (in a section for example), so perhaps that’s the issue?
No.
My stumbling block is that it appears to search the actual file name only and not the the title or categories. Plus it doesn’t seem to work with wet_haystack.
Yes. Designed as such.
Offline
Re: rah_file_search
Gocom wrote:
As it’s supposed to do.
I thought so. I was contrasting my experience with Ax’s in hopes it might help him figure a way to use the plugin_in w/out asking his readers to alter the url.
Yes. Designed as such.
I suspected that was the case.
This site I’m working on is the first one with a number of files to use your plugin (my last site with lots of files to download was long before you released this). So it’s the first time I’m really figuring it out.
This site is for a teacher. She has downloads for the kids. The limitation of searching only file names may mean it’s not the right fit for this use case. Perhpas a custom google search instead. But just to check – is there a place in the code I could easily alter it to check the file title instead of the file name>
Thanks
Mike
Offline
Re: rah_file_search
An another update released. Version 0.5 changes:
- Added title to searchable fields in addition to filename and description.
Offline
Re: rah_file_search
Works perfect!
Thanks Jukka!
Offline
#28 2011-02-23 23:14:18
- ax
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 166
Re: rah_file_search
maverick wrote:
Works perfect!
Thanks Jukka!
Yes, it works perfectly for me too (in a section). Thanks, Jukka!
The only issue that I still have is that it cannot be used to upgrade rah_link_search to 0.5 when you do %s/file/link/g in the source file, because I would really need both plugins. Obviously, it is more complicated than that?
Offline
Re: rah_file_search
Jukka, thanks for this plugin. I’m getting mixed results though, and thought I’d ask for help:
For a file named “Red Sports Sedan 2010,” The search term “red” will return this file. But the search terms “red sports” or “red sedan” won’t return anything.
Relevant part of default page template:
<h2>File Results</h2>
<txp:rah_file_search limit="12" form="file_search_results" />
Form “file_search_results”:
<h3 class="entry-title"><a href="<txp:file_download_link />" title="Download <txp:file_download_name /> now"><txp:file_download_name title="1" /></a> </h3>
<p class="entry-summary">Filename: <txp:file_download_name /> [<txp:file_download_size />]<br />
Category: "<txp:file_download_category title="1" />"<br />
<txp:file_download_description />
</p>
Form “search”:
<div class="moduletable">
<txp:search_input match="any" form="search_form" />
</div>
Form “search_form”:
<form action="<txp:site_url />" method="post">
<div class="search">
<input name="q" id="mod_search_searchword" maxlength="40" alt="Search" class="inputbox" type="text" size="20" value="Search..." onblur="if(this.value=='') this.value='Search...';" onfocus="if(this.value=='Search...') this.value='';" />
</div>
</form>
Offline
Re: rah_file_search
maruchan wrote:
For a file named “Red Sports Sedan 2010,” The search term “red” will return this file. But the search terms “red sports” or “red sedan” won’t return anything.
Nothing wrong with the form or anything. It just is that the plugin doesn’t match individual words — currently. Might change in the future ;)
Offline