Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2013-06-28 13:27:53
- hevling
- New Member
- Registered: 2013-06-28
- Posts: 1
articles, links, photos in 1 list
Hi,
I’m newbie within the Textpattern CMS.
Is it possible to show all articles, links, … actually each content element within 1 single list/overview chronological?
Kind regards,
Offline
Re: articles, links, photos in 1 list
Hi hevling, welcome to the forum!
I don’t think it’s possible natively, because they have too different structure, but you have at least two plugin solution:
- either query db tables (
textpattern, txp_link, ...
) directly withsmd_query
oretc_query
; - or use appropriately crafted
<txp:article_custom />
,<txp:linklist />
, … tags, and then merge the lists withetc_query
.
You can also do it client-side in javascript. Just shout if you need help.
Offline
Re: articles, links, photos in 1 list
Here is how you can merge articles and files in one list sorted by date, if XSL extension is enabled on your server:
<txp:variable name="mix">
<dl>
<txp:article_custom>
<dt><txp:posted format="%Y-%m-%d" /></dt>
<dd><txp:title /></dd>
</txp:article_custom>
<txp:file_download_list>
<dt><txp:file_download_modified format="%Y-%m-%d" /></dt>
<dd><txp:file_download_name /></dd>
</txp:file_download_list>
</dl>
</txp:variable>
<txp:etc_query data='<txp:variable name="mix" />'>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" />
<xsl:template match="dl">
<dl>
<xsl:for-each select="dt">
<xsl:sort select="." order="descending" />
<xsl:copy-of select="." />
<xsl:copy-of select="following-sibling::dd[1]" />
</xsl:for-each>
</dl>
</xsl:template>
</xsl:stylesheet>
</txp:etc_query>
Offline
Pages: 1