- Messaggi: 1
- Ringraziamenti ricevuti 0
Custom messages based on results
- arcaswebdesign
- Autore della discussione
- Offline
- Nuovo Utente
Less
Di più
8 Anni 6 Mesi fa - 8 Anni 6 Mesi fa #2421
da arcaswebdesign
Custom messages based on results è stato creato da arcaswebdesign
Hi, very happy with your component so far and I've managed to get it working in the way we were looking for.
There is one thing which I would like to be able to do and I was looking for a bit of guidance on how/if it is possible and that is to display custom messages above the actual results.
We're using the component to search through Joomla articles on different types of car seats for children based on their age/weight and it's returning results properly after I've tagged them. The client was also looking for a few custom messages to be displayed based on the search criteria to go alongside the results. So if the user has searched for age 1 year old and weight 18kg then certain results are returned (which already works) but also a custom message to be displayed above them?
I'm comfortable performing template overrides and PHP stuff so was hoping it would somehow be possible for me to just manually add in a few custom messages (4 of them) which will only be displayed if certain search criteria have been included? Is this in any way possible? Something like this:
Are there variables I can tap into to check these values? Or is there another way to do this?
There is one thing which I would like to be able to do and I was looking for a bit of guidance on how/if it is possible and that is to display custom messages above the actual results.
We're using the component to search through Joomla articles on different types of car seats for children based on their age/weight and it's returning results properly after I've tagged them. The client was also looking for a few custom messages to be displayed based on the search criteria to go alongside the results. So if the user has searched for age 1 year old and weight 18kg then certain results are returned (which already works) but also a custom message to be displayed above them?
I'm comfortable performing template overrides and PHP stuff so was hoping it would somehow be possible for me to just manually add in a few custom messages (4 of them) which will only be displayed if certain search criteria have been included? Is this in any way possible? Something like this:
Code:
if field_age is ((0 or 1 or 2 or 3) and field_weight is (15kg or 16kg or 17kg)) then {
DISPLAY MESSAGE 1 }
if field_weight is (10kg or 11kg or 12kg)) then {
DISPLAY MESSAGE 2 }
Are there variables I can tap into to check these values? Or is there another way to do this?
Ultima Modifica 8 Anni 6 Mesi fa da arcaswebdesign.
Si prega Accesso o Crea un account a partecipare alla conversazione.
- andrea_4g
- Offline
- Amministratore
Less
Di più
- Messaggi: 1122
- Ringraziamenti ricevuti 163
8 Anni 6 Mesi fa #2422
da andrea_4g
Risposta da andrea_4g al topic Custom messages based on results
There are ways to do that. More than one.
Search parameters are passed to the view as "$this->search_pars".
You can read and process them with a template override.
The cleaner method is to write your own custom *customproperties* plugin that, in turn, will be triggered by the following line in file components/com_customproperties/views/search/view.html.php:
You can then place the output returned by such plugin on your page by means of custom properties parameters:
Results Formatting > Header Layout > Row[x] : Plugin Output
Search parameters are passed to the view as "$this->search_pars".
You can read and process them with a template override.
The cleaner method is to write your own custom *customproperties* plugin that, in turn, will be triggered by the following line in file components/com_customproperties/views/search/view.html.php:
Code:
$pluginOutput = $dispatcher->trigger('onAfterQuery', array (&$items, &$search_pars, &$params, $pagination));
You can then place the output returned by such plugin on your page by means of custom properties parameters:
Results Formatting > Header Layout > Row[x] : Plugin Output
Si prega Accesso o Crea un account a partecipare alla conversazione.
Tempo creazione pagina: 0.149 secondi