Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2005-05-14 16:11:26

zoeglingjulian
Member
From: London, UK
Registered: 2004-12-23
Posts: 52
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

I got the plugin working on rev360… but I must admit because I don’t have the slightest idea of PHP (know a bit java though), I’m not sure if this would work for everybody… Basically I just copied and pasted from other plugins, but hey — works for me ;)

Anybody interested in trying it out? Download here (on the plugins page, click “edit” and then paste the contents of the file — but backup first ;))

Last edited by zoeglingjulian (2005-05-14 16:12:50)

Offline

#50 2005-05-16 17:40:11

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

Just wondering if this plugin is still being supported. To clarify, what I require for my content is:

1) excerpt to automatically generate WITH tags and formatting even if there is no existing excerpt from the body
2) excerpt taken to be only the first paragraph regardless of specific number of words or characters – simply that the pargraph it uses as the excerpt will be the first one which opens and closers with <p><?p>
3) excerpt of first paragraph is followed by the read more link

Could someone clarify if the plugin covers those two requirements?

Thanks

Offline

#51 2005-05-16 17:52:17

zoeglingjulian
Member
From: London, UK
Registered: 2004-12-23
Posts: 52
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

Well yeah, if you download the one I linked, it actually covers the two requirements… only that you’ve got three, out of which number 2) isn’t supported ;)

But it should be quite easy to modify it yourself (though it may take some time to understand what does what — but from that point on, it should be easy), even I who never did anything with php was able to fix some things.

I’d do it for you if I knew php, but because I don’t really do, I guess it would take me too much time.

Last edited by zoeglingjulian (2005-05-16 17:55:54)

Offline

#52 2005-05-16 19:57:29

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

Hmm I just tried this and found it didn’t display any content, and the only time it had na excerpt was if I manually entered it.

I used the following in the form, which I named “begin”
<pre>
<h2 class=“feature”><txp:category1 link=“y” /></h2><br />
<txp:permlink><txp:title /></txp:permlink><br />
<small>Written by: <txp:author link=“y” /></small><br />
<txp:beginning length=25 /><br />
<txp:permlink>click here for more</txp:permlink>
</pre>

I then added the tags in the template here:
<pre>
<div id=“menu” class=“featureexcerpt box”>
<txp:article_custom form=“begin” limit=“1” category=“feature” sortby=“Posted” sortdir=“desc” excerpted=“y” />
</div>
</pre>

but I couldn’t get it work. With a manually entered excerpt it did display the more link, but part of the feature I wanted was the auto-excerpt added in without my need to.

Could someone advise on this?

Also, zoeglingjulian on further, er, expermentation I found this plugin met all the conditions in that it takes (well in theory) the exceprt from the body with tags and formatting included; prints the first paragraph based on character count – so if all my pargraphs are about 100 characters then I set a limit of 80 and the firt paragraoh that exceeds that limit is then printed on the page; and finally it does the read more link.

Now if I can only get it working.

I am using the latest release as on the front page of this site.

Thanks in advance

Offline

#53 2005-05-18 17:48:07

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

ok managed to get this working – great plugin, although it seems to work based on the length of characters rather than the number of paragraphs, I assumed it would post the first pargraph which had over x amount of characters rather than up to x amount of characters for particular paragraph:)

Anyway, is it possible to adda trail of periods after the last letter? It looks a bit odd with some some words finish half way. Adding a trail would at least make it look a little better.

Cheers

Offline

#54 2005-05-24 04:41:07

ss
Member
Registered: 2004-03-31
Posts: 20

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

thanks for this plugin! this was just what i was looking for. it was either this or kgr_safe_excerpt but i didn’t manage to make the latter to work :-(

i’ve got the plugin working here – http://madaerah-turtle-sanctuary.org/

btw the version that worked for me was the one dowloaded from textpattern.org

Offline

#55 2005-05-25 21:45:34

philipashlock
Member
From: Bellingham, Washington - USA
Registered: 2004-06-20
Posts: 58
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

I finally went ahead and released an updated build for use with rc3

In response to those wanting an elllipses following the excerpt, I can’t figure out why you would need one considering that the plugin should be cutting off your entry at the end of a paragraph and not in the middle of the word. If you can show me examples of this happening, I’ll try to figure out why.

For those interested in having the plugin limit the number of words regardless of paragraphs, I’ll have to explain to you that this would be really unpredictable. If this was done, it would be very difficult to determine whether or not we were cutting off any tags or textile markup.

I could offer the ability to use a word count rather than a character count to determine the excerpt length though. If this is desired, please let me know.

Please let me know if you have any other questions.

Enjoy.

Last edited by philipashlock (2005-05-25 21:46:07)

Offline

#56 2005-05-25 22:12:35

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

hi phil just checked my email – i’m not sure how to explain it. BUt say I limited the thing to 135 characters – it would take say the characters from teh first paragraph at 60 then the second paragraph to make up the 135, which would then cut off the remainder which was why I needed the elilipses.

What I’ve gone ahead and done is limit any entry to 2 and half lines, this ensures that I have an almost fixes estimate of charcters. I don’t know if it’s possible, but could the plugin be set to only display the number of paragraphs regardless of character or word count, so that it displays based on the start and end of a p tag?

Cheers

Offline

#57 2005-05-26 00:48:30

philipashlock
Member
From: Bellingham, Washington - USA
Registered: 2004-06-20
Posts: 58
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

I’m not sure if i correctly understand you. Are you saying that when the remainder of your entry gets cut off, it will cut off the entry anywhere and not specifically at the end of the paragraph? The plugin is designed to end the excerpt at the end of a paragraph, so an ellipses seems a little inappropriate. You can just direct someone to the remainder of the article with a permalink and not have to denote the continuation of the article with an ellipses at the end of a paragraph (which would probably be the end of a sentence).

Ok, I just read over you entry again. Am I correct in understanding that you would like to specify the number of paragraphs to use regardless of how much text is in them? This is definately something that I could do, but I’m not sure how many people will need such a feature. However, if I’m correct in understanding what you want, I’ll try to find some time to make the modification to provide this feature.

Last edited by philipashlock (2005-05-26 00:51:57)

Offline

#58 2005-05-29 05:52:52

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

Just wanted to add my appreciation for this plugin!

Very useful and versatile…

Cheers


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#59 2005-05-29 05:52:57

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

Just wanted to add my appreciation for this plugin!

Very useful and versatile…

Cheers


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#60 2005-05-29 05:53:06

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Plugin: pfa_beginning - excerpt generation based on length attribute

Just wanted to add my appreciation for this plugin!

Very useful and versatile…

Cheers


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

Board footer

Powered by FluxBB