Keyword

Categories title and description in search results

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
11 years 2 months ago #115952 by theant
Hello
how to include categories title and description into search results?
I use them as introduction/description of all the contents/articles. They are very important and I think they should be included into search.
Even advanced search plugin/module do include them and I don't understand why.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 2 months ago #115953 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Categories title and description in search results
You can easily override generic php and include the category description.

Just use this snippet
<?php if (!empty($item->category->description)): ?>
					<p class="categoryDesc"><?php echo $item->category->description; ?></p>
					<?php endif; ?>

You can also var_dump the category to see if you need any more elements
<pre><?php var_dump($item->category); ?></pre>

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

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

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
11 years 2 months ago #115954 by theant
ehmmm... where?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 2 months ago #115955 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Categories title and description in search results

You can easily override generic.php


The file is located on your root K2 template folder and it is called generic.php.

PS. You must include it within the loop (the foreach() loop. )

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

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

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
11 years 2 months ago #115956 by theant
Sorry, I think that I have not explained well. I wish Joomla search the word/s also into the title and the description of the categories.

For example:

category “Cars with wheels"
description: "In this category there are all the cars with at least 3 wheels".

Searching “wheel" I will get this category and all the articles with ”wheel“ into results.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 2 months ago #115957 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Categories title and description in search results
Oh,

You should look for an extension of use Joomla!'s search (com_search - although not 100% sure about this ) to achieve this functionality.

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

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

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
11 years 2 months ago #115958 by theant
ok, thanks.

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


Powered by Kunena Forum