Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2005-10-08 11:19:10

Vitruvius
Plugin Author
Registered: 2004-09-21
Posts: 121

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

For anyone that is interested, I have added a vaguely useless feature to this plugin to get around a unique problem I was having.

I had wanted to have two excerpts – one a very short one, the other a bit more like an opening paragraph. (I needed the very short one for a quick grab in a list of articles on a frontpage, and the longer one on a lower order list page).

I added a <code>excerptlength=”“</code> parameter to the plugin. This essentially gives the plugin a desired excerpt length to check against. If the stored excerpt is shorter than the <code>excerptlength</code> length, then it goes ahead and makes a new one (based on the <code>length</code> attribute).

So now I add the super short excerpt in the excerpt field of an article, and let this plugin create a longer one if needed.

Not sure if anyone else would ever require such an obscure function – but hey – you never know… If anyone wants the code – let me know…

SH

Offline

#86 2005-10-31 22:22:22

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

I cant remember exactly how this plug-in works.

tinifly wrote in post #65: <blockquote> Would it be possible to not wrap the excerpt in a p tag if the excerpt has been manually entered and has a p already. As it is, if I add text to the excerpt I end up with the following generated by pfa_beginning: <code><p> <p>manually entered excerpt</p> </p></code> Notice the extraneous p tags. Not exactly valid.</blockquote>

And philipashlock replied: <blockquote>tinyfly: I updated the plugin and removed the extraneous tags.</blockquote>

But in *the help for v0.5 (last version) it says:

First, in the plug-in help, it says: <blockquote>If you’ve created an excerpt for an entry then your excerpt will be used in place of anything generated by this plugin, <strong>but note that this plugin will wrap your excerpt in a paragraph tag</strong>. </blockquote>

Edit: actually, the plug-in doesnt wrap a manual excerpt in “p” tags, but the plug-in help wasnt updated.
That was the behavior I was expecting, because if manual excerpts are wrapped in “p” tags, that implies other block elements cannot be used in the excerpt.
So, with this plug-in, it seems to be safe to use “ul”, “ol”, h<i>n</i>” and other block elements inside the excerpt.

Saludos!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#87 2005-10-31 23:18:12

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

It would be nice if this nice and powerful plug-in could add support for custom fields for the “linktext” attribute.

This way, you can set a custom field to contain the text for the linktext.

Why? Not always the classics “read more”, “continue reading”, “read full article” fit to every content (added as an article) in the site.

So, if the link text can be pulled from a custom field, it would be great for having different text when necessary.
Of course, if you dont add any text to the custom fields, it should revert to a default value like “read more” or whatever.

Finally, related with “read more” links, there is a nice technique written by Russ Weakley. Follow the links on that article for revisited versions of the technique.

Last edited by maniqui (2005-10-31 23:20:11)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#88 2005-11-02 17:33:43

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

I dont know if philipashlock (the developer of this plug-in) continues supporting this plug-in, because his last post in the forum was four month ago.

But I would like to add two more feature requests for this plug-in:

  1. some kind of “inside-excerpt” attribute for the permlink (linktext) generated by the plug-in. With this attribute (0/1), the “read more” link should be automatically included inside the excerpt, before the last closing <code></p></code>.
  2. another feature will be separate the plug-in in two tag: pfa_beginning, and pfa_beginning_link. So, you can have the excerpt in one place and the linktext in another place, like inside a div or unordererd list that contains some metadata related with the article.

If the plug-in has been abandoned by the author, maybe someone wants to pick it up and continue the developing.
But first, the author should be contacted.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#89 2005-11-07 11:44:42

edeverett
Archived Plugin Author
From: London
Registered: 2005-03-17
Posts: 42
Website

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

Maniqui,

I’ve made a version of the plugin for that answers your first point. It outputs something like this:

<pre>
<code>
&lt;p&gt; Last paragraph of excerpt. &lt;span class=“morelink”>*LINK*&lt;/span> &lt;/p&gt;
</pre>
</code>

I’m just learning some PHP so am not confident enough to release it publicly or support it, but, if you (or anyone else) are interested, email me.

</br>
Ed.

Offline

#90 2005-12-30 06:04:53

sominty
Member
Registered: 2005-12-27
Posts: 16

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

Does anybody have this working on the latest version of TextPattern?

Offline

#91 2005-12-30 09:26:10

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

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

sominty,

there is an updated version of this plugin released by edeverett, but I don’t know if it works with the newest version. you can find that plugin available here:

http://forum.textpattern.com/viewtopic.php?id=12923

I’m not sure if either his plugin or mine works on the newest version textpattern (4.0.3), so if you could clarify any issues that you are having that would be helpful. I won’t be able to work on this until next week unfortunately, but on sunday or monday I’ll see what i can do.

I’ll do my best to continue to follow the evolution of this plugin to see how I assist in its maintenance and further development.

Last edited by philipashlock (2005-12-30 09:33:25)

Offline

#92 2006-01-10 07:08:01

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

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

When I try to install it in 4.0.3 I get “Notice: unserialize() [function.unserialize]: Argument is not a string in C:\root\test\textpattern\include\txp_plugin.php on line 155”

Do you have the same problem?
Thanks

Offline

#93 2006-01-11 23:33:34

BZ
Member
From: Stuttgart, Germany
Registered: 2005-11-24
Posts: 65
Website

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

> Vitruvius wrote:

> I added a <code>excerptlength=”“</code> parameter to the plugin. This essentially gives the plugin a desired excerpt length to check against.

Vitruvius,

this is actually what I’m looking for! Please share this for download, or something. Hope you are still following this thread.


Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com

Offline

#94 2006-01-12 14:42:57

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

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

You might want to look here

Offline

#95 2006-01-12 21:35:22

BZ
Member
From: Stuttgart, Germany
Registered: 2005-11-24
Posts: 65
Website

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

thanks, tinyfly, but this plugin doesn’t do what I’m looking for. I need a feature so that the beginning of the article is displayed in the list, no matter if the article has an excerpt or not.

Any ideas?

Edit: Just commented out the if..else condition which checks if the article contains an excerpt…works fine!

Last edited by BZ (2006-01-12 22:13:56)


Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com

Offline

#96 2006-01-27 11:05:40

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

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

NOTE: This plugin is now maintained as Beginning and not pfa_beginning and can be found at http://forum.textpattern.com/viewtopic.php?pid=96955

Offline

Board footer

Powered by FluxBB