[Résolu] Résultats de recherche et Champs

More
13 years 4 days ago - 13 years 3 days ago #20535 by kim
Bonjour,

Est-ce qu'il est possible d'ajouter des champs de Flexi dans la page de résultat d'une recherche avancée?
Ou dit autrement, peut-on appliquer un template à la page recherche?

Je cherche une idée...

Kim.
Last edit: 13 years 3 days ago by kim.

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

More
13 years 4 days ago #20537 by ggppdk
v1.5.6

This was my initial thought too, when i learned that enjoyman had started to implement a (precalculated) search index of item fields, it can be done the same way as we had done for standard joomla search (see Forum Thread), actually maybe it will be easier, but we need to add parameter to select , language strings etc.

What you ask along with renaming "advance searchable" parameter of fields to "Precalculated Index Searchable" and other changes like hiding this parameter for title , description and maybe other fields too,
and making some warning to user to Purge/Recalculate the Index, when enabling the "advance searchable" parameter for a field is to be done for FLEXIcontent v1.5.6 RC2, i will soon POST v1.5.6 RC1

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
13 years 4 days ago #20538 by kim
I don't know, if i understood all what you said...

I had the version 156.
The search in the field it's ok.
But i want just display 2 fields associated at the item, not necessarily searched.

You see...

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

More
13 years 4 days ago #20539 by kim
A question:

if i have access to the item, why i can't do write this.

$this->item->fields->display;

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

More
13 years 3 days ago #20541 by ggppdk
Since we don't have a template LAYOUT (aka called search layout like item layout and category layout), i had thought of adding this layout, but this is to be done for v1.5.7

The other alternative is to add a template parameter to select fields, but i am thinking against this and probably will add a template layout.

FOR NOW: You can create a template override for the flexicontent search view, particularly only for the results file:

1. Inside your Joomla Template create folder:
templates/mytemplate/html/com_flexicontent/search/
inside this folder copy the file
components\com_flexicontent\views\search\tmpl\default_results.php

2. In this new file:
Put just after :
<?php
foreach( $this->results as $result ) : ?>

this code (alter THE field NAMES to put what you need):
Code:
<?php $item_id = intval($result->slug); JRequest::setVar('id', $item_id); $itemmodel = new FlexicontentModelItems(); $item = $itemmodel->getItem(); $item_link = JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug)); FlexicontentFields::getFields(array(&$item)); $voting = FlexicontentFields::getFieldDisplay(&$item, 'voting'); $hits = FlexicontentFields::getFieldDisplay(&$item, 'hits'); $created_by = FlexicontentFields::getFieldDisplay(&$item, 'created_by'); $voting_label = $item->onDemandFields['voting']->label; $hits_label = $item->onDemandFields['hits']->label; $created_by_label = $item->onDemandFields['created_by']->label; if (!$item->onDemandFields['voting']->noaccess) echo "<b>".$voting_label."</b>: ".$voting; if (!$item->onDemandFields['hits']->noaccess) echo "<b>".$hits_label."</b>: ". $hits."<br>"; if (!$item->onDemandFields['created_by']->noaccess) echo "<b>".$created_by_label."</b>: ".$created_by."<br>"; ?>

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
13 years 3 days ago #20542 by kim
yeah, great :)



For example:
Code:
<table id="flexitable" class="flexitable" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<?php echo $this->category->name; ?>"> <?php foreach( $this->results as $result ) : ?> <tr class="sectiontableentry<?php echo $item->odd ; ?>"> <td class="cell_title"> [url=<?php echo JRoute::_($result->href); ?>]<?php echo $this->escape($result->title);?>[/url] </td> <td> <?php $item_id = intval($result->slug); JRequest::setVar('id', $item_id); $itemmodel = new FlexicontentModelItems(); $item = $itemmodel->getItem(); $item_link = JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug)); FlexicontentFields::getFields(array(&$item)); $pathologie = FlexicontentFields::getFieldDisplay(&$item, 'pathologie'); if (!$item->onDemandFields['pathologie']->noaccess) echo $pathologie; ?> </td> <td class="cell_statut"> <?php $statut = FlexicontentFields::getFieldDisplay(&$item, 'statut'); if (!$item->onDemandFields['statut']->noaccess) echo '<img src="/components/com_flexicontent/icones/statut_'.$statut.'.png">'; ?> </td> </tr> <?php endforeach; ?> <tr> </tr> </table>

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.353 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline