Skip to content

Instantly share code, notes, and snippets.

@talkingnews
Created July 11, 2012 10:52
Show Gist options
  • Save talkingnews/3089627 to your computer and use it in GitHub Desktop.
Save talkingnews/3089627 to your computer and use it in GitHub Desktop.
Lex tag parser noparse question
Pyrostreams loop and single tests. <br />
<br />
Note: You can prevent parsing of Lex tags with <br /><br />
{{ noparse }}
<br />{{ noparse }}
Hello, {{ name }}!
{{ /noparse }}
{{ /noparse }}<br /><br />
I would expect the following code to output the most recent entries (which were entered as "one", "two", "three" etc) to output the most recent 5 items:
<br />
{{ noparse }}
{{ streams:keypass limit="5" order_by="created" sort="desc" }}
{{ keypass_entered }},
{{ /streams:keypass }}
{{ /noparse }}<br /><br />
This is what it outputs, and it is correct:
<br />
{{ streams:keypass limit="5" order_by="created" sort="desc" }} {{ keypass_entered }},
{{ /streams:keypass }}<br />
The same goes for this code:
<br /><br />
{{ noparse }}
{{ streams:cycle stream="keypass" limit="5" order_by="created" sort="desc" }} {{ keypass_entered }},
{{ /streams:cycle }} <br />
{{ noparse }}
<br />
However, for single streams, the code is:
<br /><br />
{{ noparse }}
{{ streams:single stream="keypass" sort="desc" }}
<br />Using Single Stream, this is the latest number entered: <b>{{ keypass_entered }}</b><br />
{{ /streams:single }} {{ streams:cycle stream="keypass" limit="1" }}
<br />
{{ noparse }}
<br />
But the output is:<br /> { streams:single stream="keypass" sort="desc" }}
<br />Using Single Stream, this is the latest number entered: <b>{{ keypass_entered }}</b><br />
{{ /streams:single }} {{ streams:cycle stream="keypass" limit="1" }}
{{ streams:form stream="keypass" mode="new" }} {{ form_open }} {{ fields }} {{ error }}{{ input }} {{ /fields }} {{ form_submit }} {{ form_close }} {{ /streams:form }}<br />
<br />
<br />
<br />
<p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment