modx@mindspill.net Reply #1, 5 years, 9 months ago
Update 05//02/2007: Fixed two problems whereby php complained that a function was being declared twice or didn't exist.
Update 11/07/2006: I've replaced the attached zip file with 3 new ones - a zip, a gzip and a txt - because people were having problems unzipping the original.
Hi all.
I've modified the FlexSearchForm snippet to support the following:
The new parameters are as follows:
&useWeblink - [ true | false ] If true and the doc is of type 'reference', link to the doc's weblink (it's 'content' field) rather than to the doc itself. Defaults to false.
&weblinkClass - [ string ] CSS class for a weblink's anchor. Defaults to "weblink".
Note that the code I modified was that of MadeMyDay's (posted on the MODx forums at http://modxcms.com/forums/index.php/topic,2762.0.html) which added support for showing an extract of the context with highlighted search terms. The display of content extracts makes it particularly important to prevent private documents being listed to those without permission to view them.
Steph
Update 11/07/2006: I've replaced the attached zip file with 3 new ones - a zip, a gzip and a txt - because people were having problems unzipping the original.
Hi all.
I've modified the FlexSearchForm snippet to support the following:
-
[list]
- Access control, i.e. hide private documents if the user doesn't have permission to view them. This functionality uses code lifted from the MODx getDocumentObject method in document.parser.class.inc.php.
- Added better support for weblinks.
The new parameters are as follows:
&useWeblink - [ true | false ] If true and the doc is of type 'reference', link to the doc's weblink (it's 'content' field) rather than to the doc itself. Defaults to false.
&weblinkClass - [ string ] CSS class for a weblink's anchor. Defaults to "weblink".
Note that the code I modified was that of MadeMyDay's (posted on the MODx forums at http://modxcms.com/forums/index.php/topic,2762.0.html) which added support for showing an extract of the context with highlighted search terms. The display of content extracts makes it particularly important to prevent private documents being listed to those without permission to view them.
Steph