11Mar 2008
Symphony Search Walkthrough
It seems there are a few Symphonians out there, both new and old, that can't quite get the 'Search' campfire service working on their site. So, I've decided to go ahead and throw together a quick guide to help my comrades out.
Before We Start
This article assumes that you have, at the very least, the following:
- A working copy of Symphony 1.7.x
- The Search campfire service composed by Alistair Kearney
- A rudimentary understanding of HTML
- Some basic reading skills
- Some searchable content on your site
First things first:
If you're here that means you've met all the requirements, so good on ya! In order to get search functionality working, you need to download and install the latest copy of the campfire service.
Click on the link I provided in the previous section and download the package. Once finished, open the package place it's entire contents in the campfire directory of your Symphony installation. In almost all cases it will be in the %Symphony Root%/campfire/ directory.
Next, go to your Symphony administration panel and navigate to your Campfire section. You'll see a new entry entitled 'Section Search'. Click on the title of the campfire service and you will be whisked away to it's information screen. At the bottom of the screen you should see a button labeled 'Install Service'. Click this button and Section Searching should now be activated on your site.
Getting Dirty:
Now that you have the actual service installed, we're going to perform some XSL magic to get your search form up and usable. Now, there are countless ways we can do this and, due to the nature of the system, we could place this code anywhere on your site. But, for the sake of simplicity, I'll take the straight forward and common approach.
Follow these steps:
- Go to your page management screen in your Symphony install's administration panel.
- Click on the 'Create New' link.
- Give your page the title 'Search'.
- Click the 'configure' button located at the top of the new page form.
- Under the 'Page Environment' section you will see a list of datasources. Select the 'Section Search' datasource.
- Close the configuration form by clicking the 'configure' button again.
- I'll keep this VERY simple. Paste this code block into the 'Body' field of your new page and click the 'Save' button.
All done! Now you have a simple search form that, when submitted, will display an ordered list of entries from your 'entries' section.
Note: Now, you may not have an entries section. It could just as well be entitled articles under your install. If this is the case, you're going to have to change a very small bit of code. From the block of code above, you will notice a hidden element within the form entitled section. This variable specifies which section you want to search. The current value of this element is entries, but in your case it might be articles or blog. Just make sure you change the value of that element to what ever existing section you'd like to search or it just won't show any results.
You can even toy with the URL schema of the search page to change what section you'd like to search on the fly!
That's all folks!
Didn't seem so hard, did it? In this tutorial you learned how easy it is to set up content searching within your Symphony installation. Hopefully, this will help some of you guys and gals who've been having trouble in getting this type of functionality up and running on your sites. If you have any trouble, please just post a comment in this article and I'll be quick to respond.
Till next time!
Thanks for the tutorial… but still not working for me.
To take a look at what's happening for me, go to:
http://www.toryhobson.com/new/
And scroll all the way down to the search form and try searching for something… It goes to a new page with a whole bunch of errors… You know what I'm doing wrong? Thanks for the help.