Joomla 1.6 and 1.7 introduced some new features regarding search, which may be helpful to you when building websites.
You may now make a link to a page which returns the results of a pre-defined Joomla search. For example, if you wanted to link to a page that contained the search results for the word “beginner”, you would configure it as follows:
- Create a new menu item by going to Menu – Main Menu, clicking New, and choosing “List Search Results” as the menu item type.
- On the right side of the screen, under Required Settings, enter the word(s) or phrase you’d like Joomla to search for in the “Search Term” field (in this case, the word “beginner”).
- There are some optional configuration items in the other panels on the right side, such as some limited display options, what modules to assign to the page, the browser page title, and so forth.
- On the left side of the screen, configure this menu item the way you would any other menu item (assign title, parent, etc)
- Click the Save button.
The resulting menu item, when clicked, will automatically perform a search for the term(s) you selected in the menu item and return the results on the screen.
What is this good for? It could be considered a fake tagging system. If a keyword appears in an article, it should be pulled up using the search. Unfortunately, Joomla’s search is not the best. The development team is working on some improvements to search, which should be available in Joomla 2.5 or 3.0 (depending on when they’re ready). Therefore, I’d recommend you not use this feature just yet — wait for the improved search first, and then this feature will be a powerful addition to Joomla.
Create a search page
The next question is how to create a generic search page, where a visitor could enter any search term. Essentially, this page is the equivalent to the search module, which displays a field where you can enter a search term and then click the search button. You would use this option if you needed a search page appearing in a menu, but you did not want the search box itself on the website.
(Now, most people look for a box with a button by it and assume it’s a search box — it’s a well-established design pattern on the web. We could debate the merit of having a menu item labeled Search and whether people would find it. But on occasion, this is something you may wish to include, so here’s the way to make it happen.)
Creating a search page was a straightforward task in Joomla 1.5, but unfortunately, the interface for doing this same task is misleading and confusing in Joomla 1.7.
- Create a new menu item by going to Menu – Main Menu, clicking New, and choosing “List Search Results” as the menu item type. You pick this option, even though you want a blank search screen without any search results pre-populating the page.
- On the right side of the screen, under Required Settings, enter nothing in the Search Term field. Even though this is labeled as a Required Setting, it actually is not.
- There are some optional configuration items in the other panels on the right side, such as some limited display options, what modules to assign to the page, the browser page title, and so forth.
- On the left side of the screen, configure this menu item the way you would any other menu item (assign title, parent, etc)
- Click the Save button.
Unfortunately, this is one of the worst user interfaces I’ve ever seen in Joomla. It could be fixed by some simple language changes.
- Include a second menu item choice. List “Search Page” as an option, in addition to “List Search Results.”
- In the “Search Page” option, don’t show what’s currently called the “Required Setting” box.
- In the “List Search Results” option, show the “Required Setting” box, and change the name of the box to “Search Term”. The search term is not required. If one is not entered, a standard blank search page is returned.
Let’s hope this interface is improved in the next Joomla release.
{loadposition jenbio}