Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
wet_if_page: Testing for listing page number
wet_if_page is a conditional tag. In article list mode, it takes a comma separated list of page numbers and compares it to the current page. The contained markup will be rendered when conditions are met, otherwise the “else” part is evaluated. wet_if_page works in articles, forms and page templates.
usage:
<txp:wet_if_page page="1,8,15,47">
condition met
<txp:else />
condition not met
</txp:wet_if_page>
A typical use case is to exclude the presentation of sticky articles on all but the first list page, i. e. on pages 2 ff:
<txp:wet_if_page>
<txp:article status="sticky" />
</txp:wet_if_page>
NB: wet_if_page
defaults to checking for the first page.
Download and further information. Motivational thread.
Last edited by wet (2006-05-27 18:34:45)
Offline
Re: wet_if_page: Testing for listing page number
Hi wet, this looks like a very handy plugin I can already think of ways to use it especially in combination with related articles recent articles menus and the offset attribute
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: wet_if_page: Testing for listing page number
Wet,
There’s not a “current” or “active” page for this is there?
Unless I missed it in the help?
I’ve often wondered how one could apply this type of thing to create “active” class for article level links in a nav menu?
am I making sense?
I think it would look like this in a form:
<code>
<txp:wet_if_page page=”?”>
<li><a class=“active” href=”<txp:permlink />”><txp:title /></a></li>
<txp:else />
<li><txp:permlink><txp:title /></permlink></li>
</txp:wet_if_page>
</code>
Know what I mean?
M
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#4 2006-05-29 04:01:08
- Jeffrey
- New Member
- Registered: 2006-05-23
- Posts: 6
Re: wet_if_page: Testing for listing page number
ma_smith wrote:
There’s not a “current” or “active” page for this is there?
I’m looking for something similar that would allow you to something like this:
<code>
<txp:if_active_page>
<li><txp:title /></li>
<txp:else />
<li><txp:permlink><txp:title /><txp:permlink /></li>
<txp:if_active_page />
</code>
<br />
so that in a navigation menu the title of the current page would be listed but not linked, while the other pages would be linked.
Or if you could at least add a class to the <code><li></code> tag, as in your example, then you could style the active page to appear with no text decoration.
Last edited by Jeffrey (2006-05-29 04:01:38)
Offline
Re: wet_if_page: Testing for listing page number
This plugin is not useful in a single article context but only in article lists (section listing, search hit listing, category listing), where paging occurs (page 1 showing articles 1 to 5, page 2 showing articles 6 to 10, and so on ). See?
Re: if_active_page
: Maybe glx_hl_current is what you’re after. You could also benefit from some of the code snippets I posted over here.
Offline
#6 2006-05-29 05:32:23
- Jeffrey
- New Member
- Registered: 2006-05-23
- Posts: 6
Re: wet_if_page: Testing for listing page number
wet wrote:
Re:
if_active_page
: Maybe glx_hl_current is what you’re after.
Yes! I think that’s what I’ve been looking for. I’ll give it a try.
You could also benefit from some of the code snippets I posted over here.
That’s a little bit beyond my TxP/PHP/MySQL comprehension level at the moment, but I’ll study it more closely if glx_hl_current
doesn’t pan out.
Thanks!
Edit: glx_hl_current
works! Thanks again!
Last edited by Jeffrey (2006-05-29 06:03:49)
Offline
Re: wet_if_page: Testing for listing page number
thx wet.
I’ll take a look.
Guess I should have searched the repository first :)
M
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Re: wet_if_page: Testing for listing page number
Hi wet
Started using it with the desired results:
example:
<code><txp:wet_if_page page=“1”>
<txp:article_custom form=“recent_article” limit=“10” sortby=“Posted” sortdir=“desc” listform=“articleform” offset=“10” />
<txp:else />
<txp:article_custom form=“recent_article” limit=“10” sortby=“Posted” sortdir=“desc” listform=“articleform” />
</txp:wet_if_page></code>
and for the articleform
<code><txp:permlink><txp:title /></txp:permlink></code>
I was kind of trying to figure out how the above could be achieved without a plugin but your work saved me a lot of head scratching.
The problem with txp and a lot (all?) blog software is that it (they) cannot recognise pages. This ends up (in many cases) having a list of (permlinked) excerpts with the same links in the sidebar.
Thank you very much for this one. I also posted a thread <a href=“http://forum.textpattern.com/viewtopic.php?id=16620”>here</a>. It is more of a wish list as opposed to a featured <strike>request</strike> idea
Last edited by colak (2006-05-29 18:33:58)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: wet_if_page: Testing for listing page number
I love to see how creativity evolves out of small nuclei and yields results one cannot imagine while building a tiny addition to this ever expanding flexible system ;-) Thanks for sharing, it’s fine to see useful applications of my work.
Offline
#10 2006-05-30 08:39:12
- RUDEWORKS
- New Member
- Registered: 2005-06-09
- Posts: 6
Re: wet_if_page: Testing for listing page number
mmmm hi, I’ve been trying to downoad this plug-in, but I think the link to wet’s blog is broken… If someone could post it here (or fix the link), It would be great.
Offline
Re: wet_if_page: Testing for listing page number
Oops. One fine day I’m going to learn how to handle this Textpattern thing ;-) Article’s up again. Sorry for the interruption, folks…
Last edited by wet (2006-05-30 10:04:43)
Offline
#12 2006-09-16 00:20:34
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: wet_if_page: Testing for listing page number
hi robert,
the download/information link is broken again. could you fix it once more, please? thx.
edit: ah, after several hours the database is back. [btw: beautiful wordpress mockup layout at a.w.o.w. * big grin *]
Last edited by uli (2006-09-16 01:29:37)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline