Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-06-08 11:44:37

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Automatic thumbnail in articles excerpts

Hello

I want to generate automatic thumbnails in my articles excerpts.

I try to use lam_dynamic_image and slir 2.0 with upm_image but it didn’t work.

This is my excerpt:

<h3>En el blog</h3>
<div class="latest-feeds">
<txp:if_individual_article>
	<txp:article_custom section="blog" limit="2" form="article_excerpt" />
<txp:else />
	<txp:article_custom section="blog" limit="2" form="article_excerpt" />
</txp:if_individual_article>
</div>

The form:

<div class="feed">
<txp:lam_article_image width=“250” />
<span class="date"><txp:posted format="%d. %m. %y" /></span>
<h4><txp:permlink><txp:title /></txp:permlink></h4>
</div> 

And this is the blog (part):

<div class="article">
	<div class="article-header">
		<span class="date"> <txp:posted /> </span>
		<span class="comment">
			<txp:if_comments>
			<txp:comment_permlink>
			<txp:comments_count /> Comentarios
			</txp:comment_permlink>
			<txp:else />
			<txp:comment_permlink>
			Deja tu comentario
			</txp:comment_permlink>
			</txp:if_comments>
		</span>
</div>
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<txp:body />
</div>

Witch plugin should i use?

Edit

This plugin maybe an option wet_article_thumb but it don’t generate an automatic thumb

Edit 2

lam_dynamic_image should work but when in my form article_excerp i put <txp:lam_article_image width="250" /> any image is displayed (well any image is displayed, with or without plugin). So i’ve been thinking that i may have something wrong in my excerpt, right?

Last edited by sebatorresi (2012-06-08 12:11:40)


Sonríe | Smile . <txp:lover />

Offline

#2 2012-06-08 13:11:39

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Automatic thumbnail in articles excerpts

Hola sebatorresi, ha’luego

I can’t understand totally what you are trying to do with your form and conditional tags, but as far as I can tell, you want to have a page which shows article excerpts with thumbnails which link through to the full article showing the full image – here is the way to do it without using plugins, nor is it styled – but it should give you a start.

One thing I should mention is that to use the article_image tag – you need to put the image #id into the article image field, not into the actual article.

Have a look here for a good txp tags explanation

On your page where you want to display the excerpts first and then link to your full articles you should have a form like the one below (not styled):

<txp:article form="display" />

And the form called display

<txp:if_article_list>

<!-- This displays the article image thumbnail, article title, - which links to the full article and article excerpt for each article and a custom link to the full article -->

<div>
<p><txp:article_image thumbnail="1" /></p>
<p><txp:permlink><txp:title /></txp:permlink></p>
<p><txp:excerpt /></p>
<txp:permlink>Read More...</txp:permlink>
</div>

<txp:else />

<!-- This displays the article image, article title and article body for a single article -->

<p><txp:article_image /></p>
<p><txp:title /></p>
<p><txp:body /></p>

</txp:if_article_list>

Last edited by tye (2012-06-11 23:45:07)

Offline

#3 2012-06-08 13:35:11

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: Automatic thumbnail in articles excerpts

Thanks

What i want to do with this is show the “latest two blog articles” but with a thumbnail image of the post

<h3>En el blog</h3>
<div class="latest-feeds">
<txp:if_individual_article>
	<txp:article_custom section="blog" limit="2" form="article_excerpt" />
<txp:else />
	<txp:article_custom section="blog" limit="2" form="article_excerpt" />
</txp:if_individual_article>
</div>

with the form article_excerpt i show the title & date plus the thumbnail. The other code (blog) is the entire article(s) on the /blog.

Is this wrong? i’ve been using it for a long time but this time my client want to put thumbnails images in the excerpt (“latest two blog articles”) and i never did it.

I don’t see how can i do with your code put the “latest two blog articles”.

And my client should generate a previous thumbnail instead of create it automatically.

Here’s an example of what my client want. Check where say “Recent Content”

Last edited by sebatorresi (2012-06-08 13:38:35)


Sonríe | Smile . <txp:lover />

Offline

#4 2012-06-08 14:12:19

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Automatic thumbnail in articles excerpts

Add limit=2” to the article tag on the page – this controls the amount of article excerpts you display.

<txp:article form="display" limit="2" />

The form uses tags to control article elements they are displayed.

txp:if_individual_article only gives the option of displaying items when a unique article is displayed – so with your example form nothing will display.

But if you use txp:if_article_list in from, then you tell txp to display the articles in a list first, then if the “permlink“http://textpattern.net/wiki/index.php?title=permlink is clicked, the full article.

This is the code you should put in the form article_excerpt, you should place the first tag I posed in your page.

If you want the form to display elsewhere, look at article_custom

<txp:if_article_list>

<!-- This displays the 2 articles-->

<div>
<p><txp:permlink><txp:article_image thumbnail="1" /></txp:permlink></p>
<p><txp:permlink><txp:title /></txp:permlink></p>
<p><txp:posted /></p>
</div>

<txp:else />

<!-- This displays a single article image -->

<p><txp:article_image /></p>
<p><txp:title /></p>
<p><txp:body /></p>

</txp:if_article_list>

Last edited by tye (2012-06-11 23:50:37)

Offline

#5 2012-06-08 14:41:37

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: Automatic thumbnail in articles excerpts

Thanks, still don’t work. Can’t see the thumbs. In fact doing this is taking other sections, not only the /blog, like /quotes that is other section out of the blog.

EDIT

I changed <txp:article by <txp:article_custom but it don’t get the thumbnails.

Last edited by sebatorresi (2012-06-08 15:07:50)


Sonríe | Smile . <txp:lover />

Offline

#6 2012-06-08 20:20:46

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Automatic thumbnail in articles excerpts

sebatorresi wrote:

I changed <txp:article by <txp:article_custom but it don’t get the thumbnails.

I’m not sure which code you are using now exactly (your own or tye’s or a mix?) so it’s hard to tell why it doesn’t work. Could you post the code you are using (on the page and in the form) please? Then we should be able to work out why you don’t get the thumbnails.

Offline

#7 2012-06-08 23:22:26

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: Automatic thumbnail in articles excerpts

Hi

Instead of use <txp:article i’m using <txp:article_custom because i want to use an specific section and not all the sections that i have. With <txp:article i can’t chose a section but with the other one yes, on the form i’m using the tye’s code (article_excerpt).


Sonríe | Smile . <txp:lover />

Offline

#8 2012-06-09 12:37:37

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Automatic thumbnail in articles excerpts

Sebastian, it’s useless speculating what code you might have, whether your form name matches that in your article tag (tye’s doesn’t for example, don’t take offence, tye :) or whether you might have set the correct parameters. Please post your exact and complete code, from page and form.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#9 2012-06-09 16:33:43

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: Automatic thumbnail in articles excerpts

Hello

Ok, thanks.

Default page:

<txp:output_form form="head" />
	<body>
		<div id="header" class="clearfix">
			<txp:output_form form="header" />
			<div id="content-top">
				<div class="slideshow">
					<txp:output_form form="slides" />
				</div>
				<div id="content-top-panel">
					<txp:output_form form="nosotros" />
				</div>
			</div>
		</div><!-- #header -->
		<div id="wrapper">
			<div id="content">
				<txp:output_form form="banner" />
				<div class="container clearfix">			
					<div class="group">
						<txp:output_form form="vision" />
					</div><!-- nosotros -->
					<div class="group">
						<txp:output_form form="latest_entries" /> <--- where i'm getting troubles.
					</div><!-- feeds (blog) -->
				</div><!-- container -->
			</div><!-- content -->
		</div><!-- wrapper -->
		<txp:output_form form="footer" />
	</body>
</html>

form latest_entries:

<txp:article_custom form="article_excerpt" section="blog" limit="2" />

form article_excerpt:

<txp:if_article_list>
<txp:permlink><txp:article_image thumbnail="1" /></txp:permlink>
<txp:permlink><txp:title /></txp:permlink>
<txp:posted />
<txp:else />
<txp:article_image />
<txp:article_title />
<txp:article_body />
</txp:if_article_list>

This’s all i have for the blog section.

Thanks


Sonríe | Smile . <txp:lover />

Offline

#10 2012-06-09 16:42:14

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Automatic thumbnail in articles excerpts

There is no <txp:article_title /> tag but you can try <txp:page_title />. Also instead of having forms in forms you can try

<txp:if_article_list>
<txp:article_custom  section="blog" limit="2">
<txp:permlink><txp:article_image thumbnail="1" /></txp:permlink>
<txp:permlink><txp:title /></txp:permlink>
<txp:posted />
</txp:article_custom>
<txp:else />
<txp:article_custom section="blog" limit="2">
<txp:article_image />
<txp:page_title />
<txp:article_body />
</txp:article_custom>
</txp:if_article_list>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Online

#11 2012-06-09 16:49:37

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: Automatic thumbnail in articles excerpts

Thanks

Using this the form article_excerpt isn’t necessary, works fine without this form.
However i still can’t see the thumbnail, the image post is displayed but not the thumbnail.

EDIT

I removed all the others forms and code to see if something is causing conflict but still the same, no thumb.

Last edited by sebatorresi (2012-06-09 17:01:09)


Sonríe | Smile . <txp:lover />

Offline

#12 2012-06-09 17:57:05

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Automatic thumbnail in articles excerpts

I spotted another non tag article_body which should be replaced with body

<txp:if_article_list>
<txp:article_custom  section="blog" limit="2">
<txp:permlink><txp:article_image thumbnail="1" /></txp:permlink>
<txp:permlink><txp:title /></txp:permlink>
<txp:posted />
</txp:article_custom>
<txp:else />
<txp:article_custom section="blog" limit="2">
<txp:article_image />
<txp:page_title />
<txp:body />
</txp:article_custom>
</txp:if_article_list>

Also can you put your page in debug and let us know where it is? It’s easier to spot bugs like this.

Last edited by colak (2012-06-09 17:58:36)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Online

Board footer

Powered by FluxBB