Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
"Second pass < 1" mystery
I noticed when setting “Number of extra parser sweeps” to 0 within the default theme, we’ve got a warning message on search results:
Try here: https://dev-demo.textpattern.co/4.8.8/?q=a
Devs, could you explain why and how to deal with no extra parser?
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: "Second pass < 1" mystery
Pat64 wrote #332171:
Devs, could you explain why
The reason is, say, <txp:search_result_count /> needs <txp:article /> to be parsed before, to populate some pagination data. Now, what if <txp:search_result_count /> must be output before <txp:article />, as in the default theme:
<txp:search_result_count /><!-- pb: pagination data is missing -->
<txp:article />
Before 4.7 one needed pgonly:
<txp:article pgonly="1" /><!-- pagination data is populated here -->
<txp:search_result_count />
<txp:article />
Since 4.7, if the pagination data is not available (yet), <txp:search_result_count /> (and the likes) postpones itself to the second parser pass, enabled by default since ages:
<txp:search_result_count /><!-- pagination data is missing, the tag is left untouched -->
<txp:article /><!-- pagination data is populated here -->
<-- second pass -->
<txp:search_result_count /><!-- the tag is parsed now -->
...
But if you disable the second pass, this will not work and txp will warn you.
and how to deal with no extra parser?
Either use pgonly, as before, or manage to put <txp:search_result_count /> and <txp:article /> on the same level in the page tree and make txp parse <txp:article /> first:
<txp:search_result_count />
<txp:article[1] /><!-- will be parsed first among its siblings -->
Offline
Re: "Second pass < 1" mystery
Thank you, Oleg.
Perfect (and well explained)!
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Pages: 1