Keyword

[SOLVED] how can i make appear "featured item" in

  • Askmail 36
  • Askmail 36's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 5 days ago - 11 years 4 days ago #118820 by Askmail 36
How can i make appear "featured" only near the title of featured items when i do a research in the standard search module?

which is the code for detecting if articles are featured or not?

any ideas?

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

  • Askmail 36
  • Askmail 36's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 5 days ago #118821 by Askmail 36
nobody knows the solution?

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

  • Askmail 36
  • Askmail 36's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 4 days ago #118822 by Askmail 36
really? no one knows the code that allow me to make a control on a featured item?

how can i do to say "if this item is featured" in the deafult_result.php?

please :(

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

  • Stefanos Mountrakis
  • Stefanos Mountrakis's Avatar
  • Offline
  • New Member
More
11 years 4 days ago #118823 by Stefanos Mountrakis
Replied by Stefanos Mountrakis on topic Re: how can i make appear "featured item" in research
if you can't load item parameters you can always load the state from the database, something like this, make sure where $id is your item Id.

$Id= ITEM ID
$db = &JFactory::getDBO();
$queryItem = "
SELECT featured
FROM #__k2_items
WHERE id = ".$Id;
$db->setQuery( $queryItem );
$state = $db->loadObjectList();
if($state[0]->featured)
{
//if its featured...
}

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

  • Askmail 36
  • Askmail 36's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 4 days ago #118824 by Askmail 36
Thank you very much for the answer:

1 - "if you can't load item parameters"

how can i load them?

2 - "make sure where $id is your item Id"

but how can i do if i'm trying to do this on a research results?
i can't write this code for each single item..

or am i missing something?

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

  • Askmail 36
  • Askmail 36's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 4 days ago #118825 by Askmail 36
and, i need only the item searched, not everyone

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

  • Stefanos Mountrakis
  • Stefanos Mountrakis's Avatar
  • Offline
  • New Member
More
11 years 4 days ago - 11 years 4 days ago #118826 by Stefanos Mountrakis
Replied by Stefanos Mountrakis on topic Re: how can i make appear "featured item" in research
if i assume that you are editing
/components/com_search/views/search/tmpl/default_results.php

you could add this code right after line 14 and remove lines from 15 to 24


i dont know if this is the best way but its working (at least for me)			

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

  • Askmail 36
  • Askmail 36's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 4 days ago - 11 years 4 days ago #118827 by Askmail 36
WOW, you are great!
Thank you very much!

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


Powered by Kunena Forum