Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-03 19:04:43

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Howe do I use excerpt as a "related snippet" or normal excerpt?

I have an excerpt on an article with category=“main-article”
It is NOT part of the article but different text which “relates”

If I have an article with an excerpt, I want it to display the excerpt in the sidebar along side the article. If I do not have an excerpt for that article I want it to show a generic sidebar article of the category=“sidenote”

EDIT Stuart (TheBombSite – below) is reminding me that the excerpt tag needs to be within an “article form”, so the solution-if there is one, relies on some php or perhaps a plugin? I still need an answer :)

This seems to be the code to accomplish that, yet the excerpt is not showing.

Any ideas?

The current code I am using is this (but it doesn’t seem to do the trick).
<code>
<div id=“sidebar”>
<txp:if_excerpt>
<div class=“excerpt”><txp:excerpt /></div><!—close excerpt—>
<txp:else />
<txp:article limit=“1” category=“side-note” />
</txp:if_excerpt>
</div> <!— close sidebar —>
</code>

This is local at the moment, please let me know if I need to update to www.

Thanks,

Matthew

Last edited by ma_smith (2006-02-03 19:54:09)


Offline

#2 2006-02-03 19:47:18

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

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

Well this probably won’t help but I’m pretty sure you can only use the “excerpt” tags within an article form template, which would mean you would have to call it with an article tag and I don’t know how you could ensure getting the right excerpt for the displayed article.


Stuart

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

Offline

#3 2006-02-03 19:50:05

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

yeah, hmm, shoulda thought o that. I guess I could make my article form include some of the layout, but that sucks. I bet there’s some PHP solution out there. Thanks for the thoughts though Stuart.

Haven’t posted near you in a bit. Good to see you around. Hope yer well – and the grandkids and their parents :)


Offline

#4 2006-02-03 20:06:45

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

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

Matthew, this should work:

On the page:
<code>
<txp:if_individual_article>
<txp:article form=“sidenote” limit=“1” />
</txp:if_individual_article>
</code>
Form ‘sidenote’:
<code>
<txp:if_excerpt>
<txp:excerpt />
<txp:else />
<txp:article_custom form=“othersidenote” limit=“1” category=“side-note” />
</txp:if_excerpt>
</code>
In your form ‘othersidenote’ whatever you want.

But, as Stuart will no doubt tell you, if you have ‘auto-append comments’ set to ‘yes’, this won’t work.

Offline

#5 2006-02-03 20:22:34

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

Doggiez,
If I were capable of bearing children I would have yours! Hmm, maybe that’s a little dramatic, but either way, I’m quite excited. I’ve done this before, but I seem to always forget to use this “depth” of layering article forms. One day I may remember when I am Stuart’s age :) (LOL!) sorry Stuart !!!:))))

Thanks! Works like a sweet charm.

Matthew


Offline

#6 2006-02-03 21:53:49

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

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

Actually Matthew, I think you will find that having Els’ babies is nigh-on impossible. I shall say no more. And I hope you don’t mean what I think you mean by “quite excited”. You’ll have Els blushing. :)


Stuart

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

Offline

#7 2006-02-03 22:33:53

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

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

You’ll have Els blushing. :)

Oh oh, now I am…

Matthew may be joking about your age but he obviously doesn’t know mine… ;)

Offline

#8 2006-02-04 01:38:29

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

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

He definitely knows mine Els. I think he needs some “clicker” training. :)


Stuart

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

Offline

#9 2006-02-04 19:02:02

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Howe do I use excerpt as a "related snippet" or normal excerpt?

What the hell is clicker training :) LOL! I’m glad you both are around here, just when I get too serious about designing a site, I run into this banter!

Much Peace,

Matthew


Offline

Board footer

Powered by FluxBB