webber12 / evoSearch

Поиск с использованием словарей phpMorphy для MODxEVO
16 stars 12 forks source link

"&noResult" not showing if HTML is in "&ownerTPL" #30

Closed modxuser closed 1 year ago

modxuser commented 3 years ago

There are a variety of ways to test this, numerous don't work, some do, the easiest way is:

This works:

Call &noResult like this:

&noResult=`<p>No results for: &quot;[+stat_request+]&quot;</p>` 

Now add

&ownerTPL=`@CODE:[+dl.wrap+]` 

This doesn't work:

Call &noResult as shown above

Change &ownerTPL to the following:

&ownerTPL=`@CODE:<ul>[+dl.wrap+]</ul>`

The "noresults" template will no-longer be shown, simply due to adding the <ul></ul>

fourroses666 commented 3 years ago

Wonder if it does work when you use a chunk for the &tpl.

&ownerTPL=`tpl-result`

<ul>[+dl.wrap+]</ul>

modxuser commented 3 years ago

Wonder if it does work when you use a chunk for the &tpl.

&ownerTPL=`tpl-result`

<ul>[+dl.wrap+]</ul>

As already mentioned in my first post: there are a variety of ways to test

One of those was using a chunk, you can add a chunk either using {{}} or without, each gives a different result

The fact that the Snippet doesn't completely adhere to how Doclister is setup makes things slightly complicated, as it's a mix of code types, some work, some don't, and some work together, whereas others don't

nick0 commented 3 years ago

Wonder if it does work when you use a chunk for the &tpl.

&ownerTPL=`tpl-result`

<ul>[+dl.wrap+]</ul>

Confirming this bug if html is in the &ownerTPL parameter. The bug also exists if a chunk with html in it is used for the &ownerTPL.

oawebdev commented 3 years ago

Got the same problem, that noresult was not showing. Now I know how to fix it, just removed html from &ownerTPL =) Thanks!

argalkin commented 1 year ago

&noneWrapOuter=0 добавить в вызов evoSearch а в 47-ой строчке сниппета assets/snippets/evoSearch/evoSearch.snippet.php добавить условие: if ($eSS->params['show_stat'] == '1' && (!empty($output))) { $output = $eSS->getSearchResultInfo() . $output; }

        Ну и добавить параметр &noResult=`<div>По запросу <u>[+stat_request+]</u> ничего не найдено. Смягчите условия поиска</div>`
webber12 commented 1 year ago

&noneWrapOuter=0 + fix https://github.com/webber12/evoSearch/commit/f17370caa07961361f9f7983be02d8aa5876c11a