Keyword

Smart Search - Results Page

  • Tom
  • Tom's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 8 months ago #123115 by Tom
Smart Search - Results Page was created by Tom
Hi there,

Apologies if this is a simple settings issue, but can't seem to find anything to configure.

I'm using the Joomla Smart Search component for my content search and at the moment, the results page only shows a title and intro text.

Ideally, I would like to include extra information in the results (K2 Author, Category, Tags, Created Date).

I believe the following file would need to be edited: SITE\components\com_finder\views\search\tmpl\default_results.php

Not sure where to start in terms of adding in code to display the above though (if that is indeed the right approach).

As ever, any assistance greatly appreciated.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #123116 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Smart Search - Results Page
Hello Tom,

Actually the com_finder has its own settings. I do not think it supports these elements from K2 however.

You can use var_dump() to see the object's available elements.

Eg in the default_result.php file you can use var_dump($this);.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Tom
  • Tom's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 8 months ago #123117 by Tom
Replied by Tom on topic Re: Smart Search - Results Page
Hi Krikor,

Thanks for this.

I'm completely useless when it comes to PHP (and a lot of other things seemingly!)

I've added that in (verbatim) to various places in the PHP file, but am getting no output in the browser.

Could you clarify how I go about this?

Thanks and apologies for my lack of understanding.

Best, Tom.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #123118 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Smart Search - Results Page
Actually some coding knowledge is required.
That is if com_finder has these values you want.

For the var_dump you can use either var_dump($this) or var_dump($this->result) arounf line 28 in default_result.php (not results).

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Tom
  • Tom's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 8 months ago #123119 by Tom
Replied by Tom on topic Re: Smart Search - Results Page
Thanks Krikor,

Seem to be making a bit of progress.

Now in the search results page, I'm getting each article in full, with a lot of code which seems to relate to the extra information at the bottom of each article.

Is there anything in particular (in style) that I should be looking for?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #123120 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Smart Search - Results Page
Wrapping it around in <pre></pre> tags will format this code.

You can use your browser's search to look if there is any elements that match your criteria eg: tags and category.

Eg. simply search for a category element in this code and see it exists.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Tom
  • Tom's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 8 months ago #123121 by Tom
Replied by Tom on topic Re: Smart Search - Results Page
Thanks Krikor,

Getting there....

Would these make sense?

["userItemCategory"]=>
string(1) "0"

["tagItemTitle"]=>
string(1) "1"

["userItemDateCreated"]=>
string(1) "0"

If so, how do I go about getting them into the results page?

Thanks again - first-class support as always.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #123122 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Smart Search - Results Page
Thank you Tom for your kind words.

Just as I was afraid com_finder does not have that data.
A custom solution requires in depth knowledge of Joomla!'s API and PHP.

I suggest you look at the JED or at getk2.org/extend for a plugin which extends com_finder's items and data.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum