Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#76 2005-06-18 17:39:40

flashlight
Member
Registered: 2004-06-01
Posts: 13

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

I’d actually like to keep the formatting. I’m wondering if there is a way for the plugin to close the tag if it spans multiple paragraphs.

Offline

#77 2005-06-19 03:07:29

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

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

the plugin could be made to see if there are open tags and close them if they haven’t been, but I don’t know how I could ensure that this was done in the proper order (ie have the tags nested as intended).

I think this would require some pretty good analysis of the tags used. I wonder if this might be easier to do before textile is applied, but I think it’s pretty much the same situation with html or textile tags. The code would probably have to run a lot of different tests to figure out what to do about open tags. This is not something I know how to do.

If anyone knows of an efficient solution, please contribute. Thanks.

Offline

#78 2005-09-05 03:44:02

TigerX4
New Member
Registered: 2005-09-05
Posts: 9

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

Could someone tell me where this plugin’s data has disapeared to? When I click on the download link all that appears in my browser is the enclosing tags for a PHP script and nothing more.

Offline

#79 2005-09-05 03:52:38

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

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

Even though you can’t see it the php is there. Press ctrl-A, to select all (or whatever the mac command for this is), ctrl-C to copy. Then paste that into the plugin box in your textpattern admin.

Offline

#80 2005-09-06 07:09:46

TigerX4
New Member
Registered: 2005-09-05
Posts: 9

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

Well whatta ya know?! Now the encoded data is there. Problem solved! :-)

Offline

#81 2005-10-01 13:31:04

apo
Member
From: Germany
Registered: 2004-10-27
Posts: 53

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

uhm… i cant get it to work properly. could also be i’m just too dumb, but i’m trying the following:

< txp:if_individual_article> < txp:article /> < p> Vorheriger Artikel: < txp:link_to_prev>&laquo; < txp:prev_title /> &laquo;< /txp:link_to_prev>< br /> N&auml;chster Artikel: < txp:link_to_next>&raquo; < txp:next_title /> &raquo;< /txp:link_to_next> < /p> < /txp:if_individual_article> < txp:if_article_list> < txp:beginning length=“500” linktext=“weiter lesen” styleclass=“morelink” /> < p> < txp:older>zurück< /txp:older> < txp:newer>vor< /txp:newer> < /p> < /txp:if_article_list>

this is the content area of my default page… but if i do so, it just shows nothing, no output. any idea on this, or corrections on my way to put the articles there? :-)

Offline

#82 2005-10-01 13:36:32

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

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

You have to put the pfa_beginning-stuff in the article form, not on the frontpage.

Offline

#83 2005-10-01 13:47:09

thomasstache
Member
From: Dresden, Germany
Registered: 2005-01-18
Posts: 14
Website

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

I was just going to write something similar, but let me elaborate some more. You should replace the <code>< txp:body /></code> tag in your “default” form with the <code>< txp:pfa_beginning /></code> stuff. That should work.

What the heck, here’s what I use to see the excerpt for the list and the full article “if individual”.

<pre><code>< h2>< txp:permlink>< txp:title />< /txp:permlink> < /h2>
< txp:if_individual_article>
< txp:body />
< /txp:if_individual_article>
< txp:if_article_list>
< txp:beginning length=“200” linktext=“Mehr&hellip;” styleclass=“more” />
< /txp:if_article_list>
</code></pre>


Thomas Stache

Offline

#84 2005-10-01 13:53:36

apo
Member
From: Germany
Registered: 2004-10-27
Posts: 53

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

ah, sorry, now i got it :-) thx

Offline

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

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

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

Board footer

Powered by FluxBB