Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-09-15 16:28:20

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

replace permalink title with thumb?

hi,
How do I replace a permalink tiltle with the articles corresponding thumbnail in an article list. Trying to create a thumbnail navigation for a portfolio site. Im sure this can be done without plugins right???

For instance ideally something like this but instead of displaying the title display the articles thumb:
<txp:recent_articles break=“li” category=“web” label=“web” labeltag=“h2” section=“web” sort=“Title asc” wraptag=“ul”/>

Or do i have to use the article custom tag if i have to use some kind of form to replace the title with the articles thumbnail.

<txp:article_custom break=“li” category=“web” label=“web” labeltag=“h2” section=“web” sort=“Title asc” wraptag=“ul” form“someformtodisplayathumb”/>

thanks
kevin

Last edited by kvnmcwebn (2007-09-15 16:29:42)


its a bad hen that wont scratch itself.
photogallery

Offline

#2 2007-09-15 16:59:33

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: replace permalink title with thumb?

this may or may not suite you but one very simple method can be found here

you dont need to use article_custom just to output an article using a form (unless you’re pulling your articles from a different section) <txp:article form=“someformtodisplayathumb” /> will work fine.

in your ‘someformtodisplayathumb’ form, you can simply have something like
<txp:permlink><txp:article_image thumbnail="1" /></txp:permlink> which will basically display an articles thumbnail linked to its article.

for a full attribute set for <txp:article_image />:http://textbook.textpattern.net/wiki/index.php?title=Txp:article_image_/

Offline

#3 2007-09-15 18:34:07

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: replace permalink title with thumb?

very nice-using the excerpt is a very simple solution. I had been trying to come up with a solution using the article image method. this does the job though…
thank you iblastoff,


its a bad hen that wont scratch itself.
photogallery

Offline

#4 2008-08-02 07:00:18

amyng
Member
Registered: 2007-01-05
Posts: 55

Re: replace permalink title with thumb?

I did a portfolio page based on Jared’s portfolio site tutorial as mentioned by iblastoff, but when I want to add a title to the excerpt, the text and images are all scrambled. Should I add text in the excerpt, or should I do a title output? I’m so confused! I just want to add a short text at the bottom of each thumbnail.

Any help would be greatly appreciated!

Amy

Last edited by amyng (2008-08-07 16:01:47)

Offline

#5 2008-08-02 07:13:04

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: replace permalink title with thumb?

Can you post the contents of the article_image tag in your page, plus the form that is called.

Offline

#6 2008-08-02 07:43:14

amyng
Member
Registered: 2007-01-05
Posts: 55

Re: replace permalink title with thumb?

Here’s the center div of my test page:

<txp:if_article_list>

<h3>August PikaPackagers</h3>
<div class=“pthumbs”>

<txp:article_custom listform=“portfolio_excerpt” /> </txp:if_article_list>

<txp:if_individual_article> <txp:article limit=“1” form=“single_test” /><txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next> </txp:if_individual_article>

And here’s the “portfolio_excerpt” form:

<txp:permlink><txp:excerpt /></txp:permlink>

Is that the information that you need? I don’t have an article_image tag…

Thanks for responding Jonathan!

Offline

#7 2008-08-02 08:05:52

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: replace permalink title with thumb?

I think you would be better off using the article_image tag instead. More flexible. Also, you don’t need to use article_custom, you can use the normal article tag instead.

Page:

<txp:if_article_list>
<h3>August PikaPackagers</h3>
<div class=“pthumbs”>
<txp:article form=“portfolio_excerpt” /> </txp:if_article_list>
<txp:if_individual_article> <txp:article limit=“1” form=“single_test” /><txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next> </txp:if_individual_article>

portfolio_excerpt form:

<txp:permlink><txp:article_image thumbnail="1" /></txp:permlink><br /><txp:excerpt />

Something like that should work fine. Its easier to place the image in the article_image field. For this, I would recommend that you use the upm_image_popper plugin.

Last edited by jstubbs (2008-08-02 08:06:28)

Offline

#8 2008-08-02 09:23:28

amyng
Member
Registered: 2007-01-05
Posts: 55

Re: replace permalink title with thumb?

Thanks Jonathan!

I’ve just downloaded upm_img_popper, so let’s see how this goes. I’ll report back!

Last edited by amyng (2008-08-02 09:29:49)

Offline

#9 2008-08-02 09:32:11

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: replace permalink title with thumb?

Depends what you want to display on the page amyng. Body text, a larger version of the article image….?

Offline

#10 2008-08-02 09:34:51

amyng
Member
Registered: 2007-01-05
Posts: 55

Re: replace permalink title with thumb?

Hmmm. It doesn’t work. Now no thumbnails are showing at the article_list page, and the articles are gone from the individual article page.(but the comments are still there).

Offline

#11 2008-08-02 09:49:34

amyng
Member
Registered: 2007-01-05
Posts: 55

Re: replace permalink title with thumb?

Solved the problem for the showing. Seems like copying text would render open and closing (") useless. Must replace them by typing in my computer.

Now there’s a new problem: how to make 3 columns of them side by side as per my previous layout? The <excerpt> seems to have cut into the flow.

(And I’ve played around with the plugin, it works wonderfully now, thanks!)

Offline

#12 2008-08-02 10:25:38

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: replace permalink title with thumb?

For this, your CSS needs some changes. What happens now is that a P tag is inserted for the excerpt, which breaks your layout.

Insert a new DIV in your form for the thumbnails and excerpts – f.e div class=“setpreview”. Then, add some classes like so:

.setpreview {
	margin: 5px 10px 5px 0;
	width: 150px;
	float: left;
	min-height: 150px;
	padding: 0;
}

The above needs tweaking depending on your image sizes.

For the P tag, use a class that distinguishes it from the normal P tag. For example: p class=“excerpt”

p.excerpt {
	text-align: left;
	padding: 5px 0 0 0;
	font-size: 0.9em;
	line-height: 1em;
}

You may need to clear the floats in your content div too.

Offline

Board footer

Powered by FluxBB