On Sep 29, 10:02 pm, Colin Jones <[email protected]> wrote:
> We are creating a simple search plugin to display a form and then send
> the search to an external server, and parse and display the results.
>
> Being very new to this, it's a bit confusing as to what directories we
> should use for the files, and also how we actually output the custom
> search results...
>
> At the moment we have:
>
> SearchPlugin
>   -> packages -> forms ->
>         configSearch.cfc - admin interface to change the hostname of
> the search box

Good.

>         searchParser.cfc - Functions to send the search request, parse
> the results. Is this the right folder for this?

./packages/form is for content types with no persistence in the
database - a so called "form type".  Historically it got this name
because it was a way to invoke the formtools engine without having to
create a corresponding content type (and underlying database table).
"Forms" behave similarly to Types in that they can be extended and
overridden in plugins and the project.  They also have their own views
(or webskins) that behave exactly the same as views for content types
-- the stobj structure is populated with the form property defaults.

So you could indeed place searchParser.cfc here.

>   -> packages -> webskins ->
>         displaySearchForm.cfm - Display the search and call the
> searchParser.cfc on submit.

The view should be placed in ./webskins/searchparser/
displaySearchForm.cfm

And you can call it in the normal way: for example, on the URL, via
skin:view tag, getView(), etc.

> So just now I can enter a search term in the box, which invokes
> searchParser (just dumps the form var at the moment) and that works,
> however I'm not sure whether searchParser.cfc should be there, and
> then I'm not sure where we would put the file to actually print out
> the results and how it would reference the normal website header/
> footer templates etc.?

If displaySearchForm is really a sort of teaser display ie. embedded
in another page, then you may need a second view like
displayPageStandard.cfm for your search results page.  Your form
action would call this page and you would process your details like a
standard form post.

For example, the action on the form might be /searchparser/
displaypagestandard (with FU) or /?
typename=searchparser&view=displayPageStandard

> Does anyone know of any guidance/examples of this type of page
> processing anywhere that might help?

Have a look at the Verity search plugin.  It's a pretty sophisticated
combination of types and views.
http://docs.farcrycms.org/display/FCPLUG/FarCry+Verity

Hope that helps,

-- geoff
http://www.daemon.com.au/

--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: [email protected]
To unsubscribe, email: [email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---

Reply via email to