Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » [archived] btx_excerpt

#1 2004-06-21 14:25:34

DougBTX
Archived Plugin Author
Registered: 2004-05-23
Posts: 22

[archived] btx_excerpt

Notice: This thread is archived, there is a native txp tag now: <txp:excerpt>

**********************************************************

URL: btx_excerpt_v0.9.1.txt

Usage: Replace <txp:excerpt /> with <txp:btx_excerpt />.

To get an excerpt list on your front page, with links to the main content, replace <txp:body /> in your default form with:

<pre>
<txp:if_individual_article><txp:body /></txp:if_individual_article>
<txp:if_article_list><txp:btx_excerpt /></txp:if_article_list>
</pre>

This assumes a default install. If you have any questions, please post below.

You can see it live at neuance.net where the purple Community Style is in use. See the thread for more information.

If you have used my btx_more_auto_excerpt mod, you should uninstal that before using this plugin.

For completeness, if you would like to “use the full body if no excerpt”, take a look at cnj_excerpt plugin.

Douglas

**********

Known bugs: (or “why this isn’t v1.0”)

  1. Whenther the more link is placed on the last line of the excerpt or just after the excerpt is a little erratic
  2. The more link has bad title text
  3. Produces invalid XHTML (it is normally valid HTML though) when excerpts are autogenerated, and sometimes when real excerpts are used.

Last edited by DougBTX (2004-06-22 15:03:05)

Offline

#2 2004-06-21 14:46:33

bleveck
Member
Registered: 2004-05-30
Posts: 52
Website

Re: [archived] btx_excerpt

God, this place is like magic. Request new feature —> new plugin < week

Offline

#3 2004-06-21 16:28:09

hippos
New Member
Registered: 2004-05-26
Posts: 2

Re: [archived] btx_excerpt

This was an important feature for me that was missing in the great TXP, so my big thanks goes to DougBTX for making it available to all TXP users..

Offline

#4 2004-06-21 17:42:57

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: [archived] btx_excerpt

Great plugin. This will be handy for lots of people I am sure.

Offline

#5 2004-06-21 21:53:17

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: [archived] btx_excerpt

Very handy,
thanks DougBTX :))

Offline

#6 2004-06-21 22:45:10

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: [archived] btx_excerpt

I have a couple of problems when I use the plugin:

1) It generates a “Permanent link to this article” hint both for the article title and for the “more…” link.

What I need is “Go to article”, instead of the “permanent link..” for the title

and

“Go to full article” for the “more”

or nothing at all.

(I will add a permalink icon below the article so that would be a third “permanent link to this article”)

2) The second problem is that the “more” link goes on the next line, whereas I want it to follow the excerpt after a couple of spaces.

Here’s the generated page section from “View Source”:

<code>
<h3><a href=”/textpattern/index.php?id=5” title=“Permanent link to this article”>Article Title</a></h3>

<p>Article Excerpt…</p>

<a href=”/textpattern/index.php?id=5” title=“Permanent link to this article”>more…</a>
</code>

Here’s my 01_excerpt form:

<code>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:if_individual_article><txp:body /></txp:if_individual_article>
<txp:if_article_list><txp:btx_excerpt /></txp:if_article_list>
</code>

… and here’s how it is used:

<code>
<txp:article form=“01_excerpt” limit=“1” />
</code>

Last edited by marco (2004-06-21 23:18:43)

Offline

#7 2004-06-21 23:20:26

bleveck
Member
Registered: 2004-05-30
Posts: 52
Website

Re: [archived] btx_excerpt

I actually have another problem. When using the more tag it deletes everything after it. So when Textile puts a paragraph around it. It deletes the close paragraph.

This actually happens on your example site as well. The only reason the page doesn’t mess up is because there is a paragraph directly after the more… link. I don’t think the page would validate though.

On the other hand, if you don’t use the more tag and there is no excerpt, the link is output with no formatting around it after the article. One can see how this might create a problem.

In the end, I think there needs to be a way to format the link that is output, or at least to not have it delete with closing tags that come after it.

Though I would like to reiterate my appreciation for the plugin.

Last edited by bleveck (2004-06-21 23:26:35)

Offline

#8 2004-06-21 23:41:49

bleveck
Member
Registered: 2004-05-30
Posts: 52
Website

Re: [archived] btx_excerpt

Oh… one more thing. There is a quick hack to fix the textile problem which is to put a </p> tag after <txp:btx_excerpt /> in your article form. But this could have problems in the future namely if the <!-- more --> tag is inside two block elements such as a p and a blockquote. The optimal solution is to have it keep all the closing tags following <!--more --> that are closing off block elements directly proceeding it. I’ll admit though, this sounds like a tough parsing problem.

Actually I’ll amend that. And believe me, I know this is alot of “advise” coming from a guy who doesn’t really know php (I’m working on it). But it would seem not too bad to collect every unclosed tag that comes before more, until you hit a closed tag. Then spit the closed forms of those tags out after the more.

Last edited by bleveck (2004-06-22 00:08:57)

Offline

#9 2004-06-22 02:04:09

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: [archived] btx_excerpt

It looks like the txp:article tag is the one that ought to be revised to take as parameters any or all of its attributes, including the excerpt;

As for the “more” link, it should be an option for any tag that outputs more than one item and not necessarily be a “permalink” but simply a link to the remaining items or the full article.

Offline

#10 2004-06-22 04:12:15

bleveck
Member
Registered: 2004-05-30
Posts: 52
Website

Re: [archived] btx_excerpt

well more what I’m thinking is that excerpts and “more…” should perhaps be separate. I guess Dean has a specific vision for excerpts being a few lines long and not really formatted. This is why block level tags are stripped out from the excerpt when it is textiled. For me at least, more… as it exists in CMSs like wordpress, which has both excerpts and a <!-- more --> function, is for of cutting off the article itself at a certain point, formatting and all.

This seemed partially what Dougbtx was trying to achieve. If you want to have excerpts, the prog uses them. Otherwise it truncates the article. But I guess it gets kinda tricky when you try to have a tag handle both article truncations and excerpts.

Last edited by bleveck (2004-06-22 07:13:44)

Offline

#11 2004-06-22 14:59:12

DougBTX
Archived Plugin Author
Registered: 2004-05-23
Posts: 22

Re: [archived] btx_excerpt

The title of the permalink bug: I think I can fix that

The cut-off problem: Yes, that’s right. It cuts up the article before Textile, not after. The best thing to do would be to autogenerate an excerpt when you actually post the article, and then put it in the excerpt field in the database. This would be a mod though, not a plugin. I’d like to know what will happen to the admin interfeace plugins before working on that, though it would probably be the same code that is in the plugin.

Then all that is neede is an if_excerpt tag, and then you can make your permalinks look like whatever you like in your “default” form.

(The plugin could be set to retextile the content, but I assume that Dean made TXP cache the textile output for a reason)

> I don&#8217;t think the page would validate though.

It will validate as HTML, so unless you are sending an xml MIME type you won’t have any problems.

> 2) The second problem is that the &#8220;more&#8221; link goes on the next line

Sometimes – actually, my solution above won’t work if you want this. You can see it putting the more link on the last line of the excerpt in my example, though it looks like you are using a real excerpt and yes, this will happen. I’ll have a look at fixing it.

Douglas

Offline

#12 2004-06-25 12:50:23

shriek
New Member
Registered: 2004-02-24
Posts: 5

Re: [archived] btx_excerpt

how can I remove the [p] tag this plugin inserts before the body text? I checked the code and could see it.

the default excerpt tag didn’t produce any [p] tag

Last edited by shriek (2004-06-25 12:50:52)

Offline

  1. Index
  2. » Archives
  3. » [archived] btx_excerpt

Board footer

Powered by FluxBB