Keyword

Customize Search Results page

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97218 by Mihir Patel
Customize Search Results page was created by Mihir Patel
after searching in a category property of K2 i get the results as default joomla com_search result page

 

I want that the search should display results like category view of category only. so either i will hv to get access to all the fields of the searched property. Can anyone tell me is there any easy way to display the search results just like the category view of items of k2 ???

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97219 by Yiota
Replied by Yiota on topic Customize Search Results page
You want to customize com_search to show the list of results with similar styling as you have in your category lists in K2, right?

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97220 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
Yes ... exactly.... Right it behaves like a default joomla search with just the item title coming being populated in search result......

 

Any way ?

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97221 by Yiota
Replied by Yiota on topic Customize Search Results page
All you have to do is to create a template override of com_search (Copy the folder search in components/com_search/views/search and paste it in templates/Your Template/html/com_k2/search) and customize the pages default_results.php, default_form.php, default.php.

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97222 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
Hmmm...well that sounds worth trying....I will get back as soon as i give it a shot.....Thanks a lot for the reply....

Between one more question I hope you won't mind?? when the K2 item is opened from backend by administrator then the creater ie the author changes to administrator..... Would be great if you can help me out with that as well.... :)

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97223 by Yiota
Replied by Yiota on topic Customize Search Results page
The author should not belong to Registered users because the registered users cannot have any rights to edit items, so they are not included in the author lists in the backend.

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97224 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
So it means I will have to change the registration type of joomla user ie user should register as type Author/Editior/Publisher.......I hope by changing that editing will not be affected from front end ???

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97225 by Yiota
Replied by Yiota on topic Customize Search Results page
Just Author group will suffice. It won't change anything in your frontend, no.

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97226 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
That was awesome......This two were hurdles to me in further development of my work... Thanks a lot...:)

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97227 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
I copied search folder from components/com_search/views/search to templates/Your Template/html/com_k2/search.....

Note:- There was no com_k2 folder within html....

 

Still i copied it...but what changes shall i do in the files you mentioned......Can you guide me more...Thnx

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97228 by Yiota
Replied by Yiota on topic Customize Search Results page
You should copy the components/com_search/views/search to templates/your_template/html/com_search and not in com_k2. It is not a K2 override, it is a search component override.

There you will edit the files to achieve the result you want.

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97229 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
Thanks now the files overridden are being used I copied the file from components/com_search/views/search to templates/your_template/html/com_search/search and removed the folder view, and tmpl........ files are overridden and the changes have started affecting......

But the main thing is K2 displays items with the item image, its extrafields etc. How will I be able to access those in the overridden files ???

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97230 by Yiota
Replied by Yiota on topic Customize Search Results page
If you want to use all the extras of the K2, images, extrafields, etc., then you should probably use the mod_k2_tools -> Search and the results would come to according to the generic.php page.

You can set the parameters for that list in K2 general parameters.

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97231 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
Probably there i can display the images, extra fields but I dont get advanced search option in mod_k2_tools....Its just simple search......

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97232 by Yiota
Replied by Yiota on topic Customize Search Results page
Either that or stick with the com_search. com_search can only provide you minimum listings. You cannot have images or extrafields, or whatever you have in K2 lists. You can only have title, introtext, category and a highlight span of the word you have searched for.

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

  • Mihir Patel
  • Mihir Patel's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 10 months ago #97233 by Mihir Patel
Replied by Mihir Patel on topic Customize Search Results page
Awww.... thats soemthing i dont wished at all.....probably have to find a way out possibly by dropping the use of K2....

Thanks for the prompt support...

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

More
13 years 10 months ago #97234 by Fone
Replied by Fone on topic Customize Search Results page
Hello!

And how could I edit the CSS of that search folder? there isn't a search.css file, just php. I want to edit the header, background, etc, like the rest of my template overrides so it looks like all my K2 items.

Thank you!

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97235 by Yiota
Replied by Yiota on topic Customize Search Results page
Just write what you need to your template.css file.

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

More
13 years 10 months ago #97236 by Fone
Replied by Fone on topic Customize Search Results page
But wouldn't this change all of them?

I will have 2 pages which will have the same images: search results and user registration, both with the same title (as my header is an image, not an image background + a text title).

Thats why I need to insert these in a K2 item, so I can style them separately!

Thank you!

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 10 months ago #97237 by Yiota
Replied by Yiota on topic Customize Search Results page
Just use a different outer container and change the CSS according to this statement. i.e.

 

In all K2 pages you have stated .catItemIntroText, for the other page define in the file an outer container like searchContainer and write to your CSS .searchContainer .catItemIntroText.

 

This way you won't change anything that already exists.

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


Powered by Kunena Forum