Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
article images
HI there,
I have a home page that contains 3 excerts of articles. When clicked upon you’re taken to the individual article page.
I want to 1. Know how to post an image along with the article and secondly if i could show a thumbnailed version of the image in my excert.
I would have no problems with styling the image the way i want once i work out how to get it in to the article so its just how to do that mainly
Thanks for any suggestions
Offline
Re: article images
When you’re on the ‘write’ tab to create/edit an article, select the ‘advanced options’ on the left. There’s room to enter the URL or ID of a single image there. In the page/template for the article (and probably in the body/excerpt of the article as well), you can use the <a href=“http://textbook.textpattern.net/wiki/index.php?title=Txp:article_image_/”>txp:article_image</a> tag to display that image in full size or its thumbnail.
Other option if you prefer textile or have a varying number of images to display: in the body, use <notextile><code>!/images/1.jpg!</code></notextile> and in the excerpt use <notextile><code>!/images/1t.jpg!</code></notextile> (‘t’ for ‘thumbnail’)
Offline
Re: article images
HI there Ruud,
Great thanks for that. Ive got the article image working fine but it doesnt seem to display a thumbnail in my excert. Ive used this code in my form:
<code><txp:article_image thumbnail=“1” /></code>
but it doesnt seem to work….?
Offline
#4 2006-09-05 00:02:27
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: article images
That little [4.0.4] next to the attribute on the wiki means the attribute is not yet available.
Offline
Re: article images
So i cant create a thumbnail for the excerpt page then? Is there any other way to do it?
Offline
Re: article images
Yes, insert <txp:thumbnail id="imageid#" /> into the excerpt field. bas_img_selector and upm_img_popper simiplify this task, so you don’t need to know the id.
Offline
#7 2006-09-05 14:34:09
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: article images
Offline
Re: article images
hi els,
thanks for the reply.
Ive tried installing the plugin and coding it like this in to my form which acts as both form for the excerpt page and the individual article page. What i want is the thumbnail on the excert page and the full sized image on the individual article page.
Heres my form with the wet tag in there but its not working. Also do you use <code><txp: article_image /></code> to display the full image on the individual page?
<code>
<txp:if_article_list>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:wet_article_thumb />
<p class=“info”><txp:posted /> by <txp:author /></p>
<txp:excerpt />
<txp:if_comments>
<p class=“comments”><txp:permlink>read on…</txp:permlink></p>
<p class=“info”><a href=”<txp:permlink />#discuss” class=“comments”>Comments (<txp:comments_count />)</a></p>
<txp:else />
<txp:if_comments_allowed><p><a href=”<txp:permlink />#discuss” class=“comments”>make a comment</a></p>
<txp:else /></txp:if_comments_allowed>
</txp:if_comments>
</txp:if_article_list>
<txp:if_individual_article>
<h2><txp:title /></h2>
<p><txp:posted /></p>
<txp:body />
<txp:if_comments>
<h2>Make a Comment</h2><div id=“comments”><p><txp:comments /></p>
</txp:if_comments>
</txp:if_individual_article></code>
Any ideas?
Offline
#9 2006-09-10 16:59:43
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: article images
Yes, <txp:article_image /> should be used to display the full image.
As far as I can see, this code should work. Did you activate the plugin? Did you enter the image id in the article image field under Advanced options? Did you create a thumbnail?
Offline
Re: article images
Hi els,
Thanks for the reply.
Ive activated the plugin. I entered the id of the image im using in advanced options( ive literally entered the article no and nothing else, thats right isnt it?). I havent created a thumbnail though?! I thought the plugin generated the thumbnail?! do i have to create it then?
Offline
#11 2006-09-10 19:29:11
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: article images
Hi elduderino,
That’s right, in the article image field should just go the image id, e.g. 4. You can find the id in the images list, by hovering over the image name, you can see it in the status bar.
Thumbnails are not created by the plugin. You can either create one yourself on your computer and upload it in the image upload screen (“Upload thumbnail”), or let Textpattern create one by entering width and height (and crop yes/no) (“Create thumbnail”).
Offline
Re: article images
Hi,
Ahhh! Im sorry ive never noticed that bit on the next page after you hit upload! Unfortunatley it still doesnt work. I dont know where the problem is. Im using the code in my form above now with this added to the bit at the bottom:
<code><txp:if_individual_article>
<h2><txp:title /></h2>
<p><txp:posted /></p>
<txp:article_image />
<txp:body /></code>
No image shows. I dont get it. Do i need something in my page template apart from directing txp towards this form?
Offline