Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-07-28 15:29:24
- ultramega
- Member
- Registered: 2006-02-26
- Posts: 221
Article list with and without images
How would you build a listing page, where it is possible to select if one wants to see article list with or without article thumb images? Do I have to do a separate section which would use article_custom with listform “textonly”? Or can I just switch on original sections listing page?
| Thumb img |
<link>title</link>
| Thumb img |
<link>title</link>
| Thumb img |
<link>title</link>
…
and after switch:
<link>title</link>
<link>title</link>
<link>title</link>
….
Offline
Re: Article list with and without images
Hi ultramega,
if you already know your first three articles will display the article image thumbnail, you could do:
<txp:article limit="3" form="with_thumb" />
<txp:article offset="3" limit="10" form="textonly" />
Then, you create the article forms (“with_thumb” and “textonly”) accordingly.
This is one way of doing it; with TxP, always there may be other ways of doing the same thing.
Offline
#3 2008-07-28 15:42:11
- ultramega
- Member
- Registered: 2006-02-26
- Posts: 221
Re: Article list with and without images
That was a quick one! But no, that is not what I’m after now, even I’m going to need exactly that kind solution elsewhere, so thanks for remembering : )
I look a solution to give faster access to tens or hundred of posts, sorted by alphabetically. When using text-only, I could offer a page where all – or at least much more articles could be found on one sight.
Offline
Re: Article list with and without images
OK, sorry, now I re-read your first post and I understand what you want: two different views of the same article list, right?
You may want to chs_if_urlvar http://textpattern.org/plugins/480/chs_if_urlvar (or, probably better, smd_if).
Both will let you send a GET variable on the URL and do some conditional things on your page/forms.
So, you create a link like this:
<a href="/section/?textonly=yes">View text only version</a>
And then, using the mentioned plug-ins, you do the trick in your article form to display different things if the URL variable is there.
Last edited by maniqui (2008-07-28 16:02:16)
Offline
#5 2008-07-28 17:00:56
- ultramega
- Member
- Registered: 2006-02-26
- Posts: 221
Re: Article list with and without images
That sounds great! Thanks!
Offline