Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-08 02:25:07

lister
Member
Registered: 2008-02-13
Posts: 76

sidebar to pull recent article/list from portfolio

Hi everyone, thanks for all the help so far..

I’ve had a full on day reading textpattern solutions and testing a site locally
and so far all is going pretty well. But I am left with one dilemma which hopefully
someone can help point me in the right direction or a link..

My site is a basic 2 column site, and consists of 4 nav links home,about us, Portfolio, Blog
So far I have the blog working with

<txp:if_individual_article> <txp:article form="blog_entry" /> <txp:else /> <txp:article limit="5"/> </txp:if_individual_article>

Now I’m working on the side bar which I would like to hold list of 3 of my most recent portfolio entries.
These entries on the side show a thumbnail and title and a small piece of copy all wrapped in a permlink to that recent Portfolio article.

I have tried using article_custom and added this to a form which output the article in the portfolio section great! but the thumbnail and small copy used in the sidebar shows up in that article which I dont want?

whats the best way to show a article thumb/title/and a few words of copy in a permlink but display the full article without the thumb and the few words in the portfolio section??

Would I need some sort of plug in
any ideas??

lister
txtpattern newbie

Offline

#2 2009-02-08 03:14:50

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: sidebar to pull recent article/list from portfolio

If I understand you correctly, you’ve pretty much almost nailed it yourself, but I might have this backwards. Make sure you have different forms setup for the different views that you want (individual/full article, listing, etc).

Your blog might have:

<txp:if_individual_article>
	<txp:article form="blog_entry" />
<txp:else />
	<txp:article limit="5" form="blog_list" />
</txp:if_individual_article>

// wherever you want your sidebar to be
<txp:article_custom section="portfolio" limit="3" form="portfolio_list" />

While your portfolio might have:

<txp:if_individual_article>
	<txp:article form="portfolio_entry" />
<txp:else />
	<txp:article limit="5" form="portfolio_list" />
</txp:if_individual_article>

Offline

#3 2009-02-08 17:43:12

lister
Member
Registered: 2008-02-13
Posts: 76

Re: sidebar to pull recent article/list from portfolio

I would really like to thank everyone so far with all the help.. I hope I’m not asking too many newb questions…

All is going pretty well, and today I have advanced the site slightly using static text for the about us. I have updated the portfolio section with its own template using this code;

<txp:body /> <txp:article form="portfolio_single" listform="portfolio_entry_list" />

I have an artcle thumbnail appear in the portfolio section with a permlink wrapped to click through to that portfolio article. Now the problem I have is, I would like to include some text with the thumbnail list before you click through to the main article. This would be easy to do, if i didnt have my most recent work/portfolio in the right sidebar with an excerpt (which has a smaller thumb in the excerpt window as a link to that article. (see images)

I somehow need 2 excerpts being pulled from the same article one for the sidebar (using article custom) and one with the thumbnail.

How can I do this? Is it possible to highlight some of the <txp:body /> and insert this with the thumbnail list
please find attahed the current images and links for the current code..

portfolio template
work_list form
portfolio_single form
portfolio_entry_list form

and some thumbs of the current testing site (please ignore the design its for development only)
portfolio_thumb_list
portfolio_article

also i tried to insert the code into the forum window using the bcc.. tag, but it added the code
but It wouldnt finish, so i couldn’t continue writing after the code was inserted.. is there an ending
tag with bcc..??

Thanks

Lister

Offline

#4 2009-02-08 18:02:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

Re: sidebar to pull recent article/list from portfolio

I somehow need 2 excerpts being pulled from the same article one for the sidebar (using article custom) and one with the thumbnail.

What kind of information are you wanting to attach to each? There is only one excerpt field, but there are several approaches to how you could achieve this:

  • Use the excerpt field for one text item and a custom_field for the other (one proviso: that it is less than 255 chars). That’s probably simplest.
  • Alternatively, if it’s just a caption for an image, you can use excerpt for your main text item and the image caption for the other attached to the thumbnail. You can display an image caption using upm_image or another image plug-in if you happen to already be using one.
  • Another approach, if for example the texts are very similar, e.g. one excerpt is a subset of the other, would be to bracket off the extra text with a span tag and then hide the span using css where you want it to be shorter, e.g. your excerpt text looks like this: This is my excerpt text<span> with an additional sentence for when there's more space</span>. Obviously this depends very much on your text.

I tried to insert the code into the forum window using the bcc.. [NOTE: it should read bc.. ] tag, but it added the code
but It wouldnt finish, so i couldn’t continue writing after the code was inserted.. is there an ending
tag with bcc..??

  • For a single line of code simply use bc. my code here, then a blank line and you can type on.
  • For multiline code, use bc.. my code over several lines here then a blank line. To tell it to switch back to a normal paragraph begin the next item with p. My next paragraph...

The same principle apples for blockquoting using bq. single paragraph quoted text... and bq.. multi-paragraph quoted text... followed by p. To restart paragraph text...

Last edited by jakob (2009-02-08 18:08:41)


TXP Builders – finely-crafted code, design and txp

Offline

#5 2009-02-08 18:03:33

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: sidebar to pull recent article/list from portfolio

It’s just bc.

There is a plug-in you can use for excerpts, rss_auto_excerpt which doesn’t rely on the excerpt textarea. Maybe you could use that in a form to combine with your larger thumb?

Last edited by thebombsite (2009-02-08 18:04:10)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2009-02-08 18:22:08

lister
Member
Registered: 2008-02-13
Posts: 76

Re: sidebar to pull recent article/list from portfolio

Thanks guys, the reason I need something like this is that sidebar uses the most recent portfolio items, but the thumbnail for that has been added in the excerpt field when I wrote the article, but the main portfolio section only displays the body, or I’d have the side bar thumb in the article list if i used the excerpt for this. Hope this makes sense..

Thanks about the code, I wasn’t adding the extra line.

Listed

Last edited by lister (2009-02-08 18:24:15)

Offline

#7 2009-02-08 19:00:19

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

Re: sidebar to pull recent article/list from portfolio

the reason I need something like this is that sidebar uses the most recent portfolio items, but the thumbnail for that has been added in the excerpt field when I wrote the article, but the main portfolio section only displays the body, or I’d have the side bar thumb in the article list if i used the excerpt for this. Hope this makes sense..

Erm, I found it difficult to make sense of that, sorry. Can you clarify exactly what you want to appear where, perhaps with an example? How have you included the thumbnail in your excerpt? Is it hard-coded into the text of the excerpt with a txp tag? If so, try using the Article Image field in the write tab to specify the ID of the image you want, and then use <txp:article_image thumbnail="1" /> in your form to display it only when you need it.

Last edited by jakob (2009-02-08 19:01:09)


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB