• North Shore Story: Reputation Management in Minnesota
    North Shore Story: Reputation Management in Minnesota

    While vacationing with our family on Minnesota's beautiful North Shore of Lake Superior, our car suffered a mishap in a construction zone. A large rock tumbled out of the dump truck in front of us and before we could react or stop, we had driven over it, leaving a 5 inch hole in the oil pan. We immediately pulled over to Split Rock State Park, where I began searching for a tow service. Luckily, I had seen a tow truck assisting someone else at another Minnesota State park two days earlier, and I remembered the name: Blazers Auto Service. Using my smartphone, I ran a search on Google and discovered that:

    • a Blazers does not have a web site.
    • b. There are plenty of online reviews - SOME QUITE NEGATIVE - in various directories (Yahoo Local, Yelp, etc.) with the phone number.
    Read more...

Phone icon for calling web design Call Today:

  • (877) 455-4994 (toll free)
  • (763) 786-9415 (mn)
  • (612) 594-4495 (cell)

Concerto Designs Minneapolis Joomla Web Design medallion logo

One of my clients uses FeedGator, a wonderful rss feed component for her large Joomla 2.5 site. Using FeedGaror's integration with K2, we have set up the feeds to display on the home page using the K2 Content Module, which shows an introtext and a "read more" for the first batch of feeds.

Our challenge has been finding a solution to exclude those feeds from site search results. In a way, the enhanced search capabilities of Joomla 2.5 work a little too well, since indexing the site content makes internal searches extremely accurate and thorough. Displaying news feeds in search results is obviously counterproductive since those links will take visitors off-site. There were some other issues with the default search due in part to the very complex nature of the site functionality (several hundreds of K2 items, Community Builder with all the bells and whistles, Kunena, etc.).

Judging from the threads in K2 and Joomla forums, there is widespread demand for some kind of K2 category exclusion feature. Our solution requires adding one line of code. Here's how we did it.

After trying a number of search options, we wound up using Acesearch, a modestly-priced, commercial search component (we also bought their K2 plugin). Acesearch works very well indeed, and styling it up to match our hand-coded template look and feel was a snap. Although backend parameters do not have an option excluding K2 categories, the solution involves adding one line of code.

As always in this kind of revision (aka a hack), you should:

  1. Make a backup of the file
  2. Open a Notepad or TextEdit document and make notes of what you did - this is important because the next upgrade of Acesearch plugin will wipe out any revisions.
  3. Normally, it'as a good idea to backup the site using the Akeeba backup component (I recommend buying Akeeba Pro - it's an essential tool in my site management). In this case, the functionality of the revised code is limited to searching, so no global impact is likely.
  4. Keep both front- and back-end views of the site open in separate browser tabs so you can test the results.

The next step is to make a note of the K2 category IDs you want to exclude - you need the category ID number, not the name.

Now you are ready! In your site directory, using your favorite code editor or else Extplorer, open: adminisrtator/components/com_acesearch/extensions/com_k2.php

Go to line 53 where you will see the following code:

if ($this->site) {
$where[] = 'a.published = 1';
$where[] = 'a.trash = 0';

Now add this code immediately below:

$where[] = 'NOT a.catid = 12';

NOTE: you will need to change the value of '12' used in the above example to your own excluded K2 category ID or IDs - for multiple ids, you use a slightly different syntax: 'NOT a.catid = (1 OR 2 OR 3)' etc. If search results are not working as expected, you can also vary the syntax to include only specific categories, e.g. a.catid = (1,2,3) etc.

logo_thumbtack_2

Look for my Joomla & CMS Web design services on Thumbtack. Thumbtack shares my expertise in hosting, email set-up,logo design / revision, content development, CMS customiization, and much more. Check out my listing to learn more!

Alan Smith's VisualCV Badge for Concerto Designs Facebook page