Closed colak closed 3 years ago
@bloke @bloatware is this achievable and OK to do? Default Textpattern behaviour is to not do a search when the search field is empty - we would need to change that behaviour here to show everything if the field is empty (and filter by custom fields, which we do in the results anyway).
<txp:if_search>
will fail if q=
is empty but this code will pass the test whether q has content or not:
<txp:if_request name="q">
YEP, haz request, content: <txp:page_url type="q" />
</txp:if_request>
So we could replace <txp:if_search>
for the above and then deal with situations where q
is empty slightly differently, perhaps with a <txp:evaluate test="page_url">
conditional.
<txp:if_article_list type="q, compatibility" />
should work for search detection, but <txp:if_search_results />
require q
be not empty.
Sorry, I don't understand either of those two solutions - can somebody please amend the page code, which I guess starts around here: https://github.com/textpattern/textpattern-plugins-website/blob/master/src/templates/pages/default.txp#L106
Thanks.
It should work now, please test.
Neat! It works on the site but I can't see any change in the repo. Did you just change it directly on the site?
One thing we might be able to do in the search message at the top is add the compatibility info requested if it's anything other than 'any', and maybe hide the search term if it's not used. e.g.
<txp:search_result_count text="plugin(s) found" />
<txp:if_variable name="compatibility" not value="Any">
compatible with Textpattern <txp:variable name="compatibility" />
</txp:if_variable>
<txp:evaluate test="search_term">matching your search request <q><txp:search_term /></q></txp:evaluate>.
Would that work?
Oops! Sorry, I have changed the site directly. Yes, evaluate
would work (even without test
), or you could also use
<txp:search_term wraptag="matching your search request <q><+></q>" />
Even better. I always forget about <+>
.
For the record, I have modified only default
page.
Oki doke. If you're done tinkering for now, I'll commit your changes to the repo.
Can anyone unravel what's going on here?
etc_
with 'Any' compatibility: 3 plugins returned.
etc_pagination (4.5-4.8)
etc_cache (4.6-4.8)
etc_datepicker (4.6-4.8).Is it because there's no max-txp-version-verified
for etc_pagination? Anything we can do about this? Or do we have to ensure that both min and max are set?
Yes the search is for verified plugins, because that plugin hasn’t been verified yet it won’t show in search results. It’s the best I could do - not precious about it though, if you can improve it that’d be fine with me.
Just looking at the code additions, curious about what this does?...
<txp:output_form yield="head, body_header, body_footer" />
@philwareham preloads and caches these forms in one go, sparing 2 further db queries. Useless if queries are cached by db engine, in which case it's safe to remove.
@Bloke @philwareham sorry, I have slightly modified default
page of the site again (too lazy to setup my local copy). Just removed two pgonly
queries, replacing them with variable
store.
I have tried to update the repo too, please check.
Done. Closing.
Describe the issue When searching for plugins compatible to a particular txp version, no results are returned after making a selection from the pulldown but text field is empty.
To reproduce Steps to reproduce the behaviour:
Expected behaviour A list of version specific plugins