<cfsetting enablecfoutputonly="true" />
<!---
Copyright 2010:
Author: Marco van den Oever
Company: MVDO-WSO
Website: http://www.webserviceonline.biz
Email: marco@webserviceonline.biz
License:
This software is licensed under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
For a copy of the GNU General Public License check the license folder or see <http://www.gnu.org/licenses/>.
Description:
Simple Searchform for dmNews.
Created: 30/05/10
Tested on CF9, FC6.0
--->
<cfimport taglib="/farcry/core/tags/formtools/" prefix="ft" />
<cfimport taglib="/farcry/core/tags/webskin/" prefix="skin" />
<cfoutput>
<!-- Start of Search Form Results -->
<!--- perform action when someone searches --->
<ft:processform action="search">
<ft:processFormObjects typename="searchform">
<!--- get search results --->
<cfset obj = createObject('component','application.stcoapifarcry.plugins.cms.packages.types.dmNews') />
<cfset props.whereclause = "objectid=objectid AND title LIKE '%#stproperties.searchfield#%' OR Body LIKE '%#stproperties.searchfield#%' OR Teaser LIKE '%#stproperties.searchfield#%'">
<cfset results = obj.getMultipleByQuery(argumentCollection=props) />
<cfset searchquery = stproperties.searchfield />
</ft:processformobjects>
</ft:processform>
<!-- End of Search Form Results -->
<!-- Start of Search Form -->
<div id="searchform">
<h2>Search</h2>
<ft:form css="style.css">
<ft:object typename="searchform" lFields="searchfield" />
<ft:farcryButtonPanel>
<ft:button value="search" />
<cfif not isdefined('results')>
No Results
</cfif>
<cfif isdefined('results.recordcount')>
<cfif results.recordcount gt 1>
#results.recordcount# Results:<br />
<cfelseif results.recordcount eq 1>
#results.recordcount# Results:<br />
<cfelse>
No Results
</cfif>
<br />
<cfloop query="results">
<skin:buildLink type="dmNews" objectid="#results.objectid#">#results.title#</skin:buildLink>
<br />
</cfloop>
</cfif>
</ft:farcryButtonPanel>
</ft:form>
</div>
<!-- End of Search Form -->
</cfoutput>
<cfsetting enablecfoutputonly="false" />
|