August 2008

Site Integrator: Search in Joomla! 1.5

Statistics, additional options, and customizing the layout

Written by Andrew Eddie

One of the many things you may notice about Version 1.5 is that Search now has it's own Administrator Component. You can access this by selecting Components -> Search from the menu. This replaces the previous location under Site -> Statistics -> Search Text in Version 1.0.

For a new install there's not much to see and if you had tried searching for something, nothing would be recorded. Let's fix that first.

Click the Parameters icon in the Toolbar.

A dialog window will overlay the screen (you'll see this effect a lot in the Administrator) and will present you will a couple of Global Configuration parameters to set. At this stage we are only interested in the first one, so set Gather Search Statistics to Yes and then click Cancel or round X button at the top-right corner of the dialog box.

The Search Logging indicator will still show Disabled until you refresh the screen after which it should change to a nice, green Enable value.

The New Search Areas

Jump over to the frontend of your site and type something in the search box followed by clicking the Go button, or pressing Enter/Return (will vary depending on what template you have installed and how the search module is configured).

With luck you've selected a word that has some results (if you've installed the Sample Data "joomla" is a good guess). Most of this screen should be familiar to you except for one new line - the Search Areas. This set of checkboxes gives you the option of searching only within certain components. If you check the box next to Web Links, only results from the Web Links data will be returned in subsequent searches. If you leave all the boxes uncheck, Joomla! will assume that you just want to search everywhere.

Choose a few more words and try one or two a couple of times

Search Statistics

Now jump back to the Search Component in the Administrator.

What you should see are all the words that you searched for and the number of times they have been requested. There is a link above the table which probably reads Show Search Results. If you click this links it toggles an extra column in the table. This column will give you a count of the number of search hits that you get for a given word or term. This is useful to look at from time to time because if you find that a word is being frequently searched, but the results are near zero then it may tell you something about what your visitors are looking for on your site.

Notes for Web Masters

It's a good idea to have a menu item for Search in one of your menus. It doesn't matter whether you tuck it away in a footer menu or let it be in a prominent position. If you don't include one, then the Search Component will only ever use the default parameters that are set internally. By including a menu item, and allowing Joomla! to find that (using the new Router) you will be able to override those settings if that is what you desire.

To add the Search Component to your menu, select Menus -> Main Menu (or any other menu you'd like).

Click New in the Toolbar.

On the next page, find and click Search under the Internal Links item in the tree that is displayed. You'll see Search / Search / Search in a tree. The first one is the Component name; the second one is the View name and the third one, which is a link, is the Layout name. Click on that last Search which is the link.

The next page is the edit form for the menu item. Enter a Title and Save.

If you now refresh your site you should see your new menu item displayed on your site.

Notes for Template Designers

The Search Component only has one View and only one Layout so it's very simple to customise.

To create a Layout Override for the Search Component, first look at your template folder. If you don't already have one, create a directory called html in your template directory. To create an override for a Component, the directory structure follow the format component_name / view_name / layout_file.php where the component _name and view_name must exactly match the directory names of the Component and the View, and the layout_file must also match the name of the layout file.

With that said, copy the file:

/components/com_search/views/search/tmpl/default.php

to

/templates/my_template/html/com_search/search/default.php 

Now make a few changes in that file and refresh your site.

In a similar fashion, you can also override the Search Module layout file. Copy the file:

/modules/mod_search/tmpl/default.php

to

/templates/my_template/html/mod_search/default.php

Modules don't support views so our directory structure is not as deep as for a Component.

For more examples of Layout Overrides, have a look at the html directory in the Beez template that ships with Joomla! 1.5.


5 Votes

8 Comments

Feed
  1. At last a VERY clear and concise list of rules summary.

    It is NOT hard though to remove those features from the page when a developer is viewing their OWN listings. A feature that is enabled and available on a page SHOULD be used by the person viewing the page else it should be REMOVED or DISABLED - that is a most basic UI principle is it not?

    And Yes, I had OFTEN (In the past - not for a while) vote if a review is helpful or not, especially on my listings as some "so called reviews" are everything but " a serious communication of a persons experience with the extension"

    If you dont want someone to click something - remove it - it takes a few seconds to write code to support that!
  2. We absolutely welcome submissions of the necessary code! Email the code to team@extensions.joomla.org and we will forward to the developers for inclusion.

    It may be easy to add that or any of another 30 or so features that have been requested. However, the JED is a volunteer effort and thus new features are submitted as the developers get time.

    The JED is getting a facelift in the near future to 1.5, although no timeline has been set, so now is an excellent time to offer solutions to the new code.

    If you have the programming written for any feature you desire in the JED, again, email to team@extensions.joomla.org and it will be evaluated for inclusion.
  3. The guidelines are pretty clear but Phil is of course correct the not-relevant options should be disabled. This is pretty much UI 101.

    Nick
  4. This issue can't be resolved by removing features from the developers view, since they don't login with their real account anyway. They create a new account, and use that one to review their own listing (or slander thier competitors).

    One possibile way to help remedy this, albeit a little extreme, is to disable reviews by new members for a given period. That way existing (i.e. real) members have a chance to review a listing first. I don't know how feasable this is, and the review system would surely suffer.

    It's a shame that just a few dishonest developers can ruin it for everybody else. They should be tarred and feathered!
  5. I second that-other-guy.

    Although it is quite extreme I believe it would probably be wise to limit reviewing and rating until an account has come of age.

    Sadly I have found that people who want to spam these types of resources really seem to have no morals at all and will take little notice of the rules.

    And there IS quite a lot at stake on the JED - a lot of traffic to the successful developers which can result in sales and/or revenue from advertising. Whenever money is involved it seems people will try and cheat the system.
  6. Thanks for the feedback, all.

    The UI changes will be in the new version of the JED.
  7. I think the JED could be improved a bit by making ratings more transparent. If someone does a review on my extension, at least I can see who it is, what other reviews they have done, which gives me an idea of how long they have been a member. If I get a rating, I have no idea who it was. This would not solve the problem listed above, of developers creating fake accounts, I can't see a way to 100% solve this, but would make things a bit harder to create a bunch of fake accounts, and do some ratings, as the history of the fake accounts would make the accounts look fake.
  8. I have searched the web for this for a long time. Finally its clear! Thanks you guys

Add Comment


    • >:o
    • :-[
    • :'(
    • :-(
    • :-D
    • :-*
    • :-)
    • :P
    • :\
    • 8-)
    • ;-)