Texpattern context demo
Section | Category | Type |
---|---|---|
context_demo | textpattern | link |
Link-category context
Links are another of Txp’s main content types. Here we see global link-category context combined with basic use of local context. Note the linklist
tag, used here as a container tag (equivalent to using linklist
as a single tag and putting the tag contents into a Txp form).
linklist
creates a local link context for each link it finds, and the enclosed tags use that context to output the correct link. link_name
and similar tags are not only context sensitive, they are completely context dependent: calling them outside link context throws an error. Txp has no global link context, so these tags must always be enclosed in a linklist
tag (or form).
This code:
<txp:if_category type="link">
<!-- Left column -->
<txp:linklist wraptag="dl" break="" limit="3">
<dt><txp:link_name /></dt>
<dd><a href="<txp:link_url />"><txp:link_url /></a></dd>
<dd><txp:link_description /></dd>
</txp:linklist>
<!-- Right column -->
<txp:linklist wraptag="dl" break="" limit="3" offset="3">
<dt><txp:link_name /></dt>
<dd><a href="<txp:link_url />"><txp:link_url /></a></dd>
<dd><txp:link_description /></dd>
</txp:linklist>
<br class="clearboth" />
</txp:if_category>
produces this output:
- Textgarden
- http://textgarden.org/
- Textpattern CMS themes
- Textpattern CMS
- http://textpattern.com/
- A flexible, elegant and easy-to-use CMS
- Textpattern Gallery Demo
- http://gallery.ipsedixit.net
- Using the new image tags introduced in Txp 4.3.0
- Textpattern on Google Code
- http://code.google.com/p/textpattern/
- Official project home for Txp developers
- Textpattern Planet
- http://txplanet.net/
- Content aggregator for Textpattern-related news
- Textpattern Resources
- http://textpattern.org/
- Official site for Textpattern CMS plugins