Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-03-27 10:37:08
- Qwest
- Member
- From: London, UK
- Registered: 2007-01-24
- Posts: 112
how to display article image + excerpt, then full post once clicked?
Sorry for the vague subject line, it’s hard to describe what I want in one sentence.
Right. I’m currently running a Coppermine PHP-Based gallery on my server. It’s caused untold security problems and I now wish to use TXP for my gallery. I’ll be using the EBL Batchupload script (once i get it working) to upload my 5000+ images, and create thumbnails for each but that’s another hurdle.
For the moment, im figuring out how to work it and display it properly. At the moment, i’ve uploaded several pictures from a club-event and put it in my gallery section. Here’s the page at the moment: http://eliteproductions.co.uk/pix
Now, for the gallery home page (/pix), i’d like to have the article title, along with the article image (thumbnail) shown plus details about the event which i’ll display using the <txp:excerpt /> tag, and a “view more” link which will be the <txp:permalink> tag linking to the actual article.
This is where i need help. I know what i want, but not sure how to get it! Can somebody help me, and tell me what forms / pages i need to create.. Im still a newbie when it comes to txp, and i’m still cutting my teeth.
Any help will be greatly appreciated :D
Last edited by Qwest (2007-03-28 14:48:49)
Offline
Re: how to display article image + excerpt, then full post once clicked?
Go to Admin>Prefs and turn “Automatically append comments to articles” to No. Try something like this in your page template (create a new page template if you haven’t already and associate it with the “pix” section:
<txp:if_article_list>
<!--location: /pix-->
<txp:article form="pix_index" />
<txp:else />
<!--location: /pix/article-title-->
<txp:article form="pix_single" />
</txp:if_article_list>
form: pix_index (type:article)
<h2>
<txp:permlink>
<txp:title />
</txp:permlink>
–
<txp:posted />
</h2>
<txp:article_image thumbnail="1" />
<!--conditional to check for excerpt-->
<txp:if_excerpt>
<!--if one is present, show it-->
<txp:excerpt />
<txp:else />
<!--or else, display the full post-->
<txp:body />
</txp:if_excerpt>
<div>
<txp:permlink>View More</txp:permlink>, <txp:comments_invite />
</div>
form: pix_single
<!--whatever you want in here-->
<h2>
<txp:title />
–
<txp:posted />
</h2>
<txp:article_image />
<txp:body />
<txp:output_form form="comments_display" />
Offline
#3 2007-03-29 04:28:32
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: how to display article image + excerpt, then full post once clicked?
Much of what you need to know is in the FAQ.
Alex
Offline