By Giora Shimoni on Tuesday, 28 July 2020
Posted in Feature Requests
Replies 4
Likes 0
Views 2.6K
Votes 0
We set up custom fields like you did in your Demo under Recipes.
Is there a way to have an error message appear when an empty search comes up?
In the layout type 'Category Blog' did you add the field type 'No Items Message' into your layout?
·
3 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
HI - Sorry - We thought the info above would be enough to help us solve the issue. Unfortunately, even after adding "no items message" to "Category Blog", we don't get the message when search results are empty.

Here is where we are trying to use this:
https://meltonschool.org/dev/learn/melton-courses

Is there documentation about adding "no items message"? We did not find documentation about it, and we also did not find a search button in https://www.easylayouts.net/ to search for "no items message".
·
3 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
It should just appear when the intro_items, lead_items, link_items (and for category list only, items) fields are empty.

You can you do a quick test to see if its being triggered and if not, why not.

If you edit the file components/com_easylayouts/output/common/no_items.php - it has 2 methods:
getOutput : which determines what to output
hasOutput : which decides if anything needs to be output.

Test 1.

In hasOutput where it says

$x = 1;

precede this with

return true;

This will force the 'no items message' to be output in all circumstances.

Now put an invalid search combination in - do you now get some output?

Test 2.

If Test 1 worked then we now need to see why its not being triggered.

replace the

return true;

from Test 1.
with

echo empty($view->get("intro_items")) ? 'Intro empty' : 'Intro not empty';
echo empty($view->get("lead_items")) ? 'Lead empty' : 'Lead not empty';
echo empty($view->get("link_items")) ? 'Link empty' : 'Link not empty';
echo empty($view->get("items")) ? 'Items empty' : 'Items not empty';

Then do an invalid search again.

It would appear that one of these is not empty, we need to find out which one and why its not empty.

If you'd like me to do these tests for you then please send temporary FTP details on the private Site Details tab below
·
3 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you very much Geraint it works.

Stay Safe

Best Regards,

--Giora
·
3 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post