Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2006-10-27 06:48:49

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

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

@Markus

You can continue editing this plugin to achieve the desired effect (add the line that is followed by the comment, “JUST ADD THIS LINE”):

$beginning = substr($body, 0, $p_end[$i]);
$beginning = '<p>' . strip_tags($beginning) . '</p>'; // JUST ADD THIS LINE
/*
It's still possible for us to generate an excerpt that is the entire article
(because we give precedence to full paragraphs rather than length).
If this hasn't occurred, then we glue on the link
*/

I’ll consider adding the feature to ignore existing excerpts if I can understand a reason for using it and if other people express interest in this feature. If it’s an isolated case, then I’ll just let you hack it as needed. The same goes for this modification (though it’s easier for me to see people wanting something like this).

So why do you want to ignore existing excerpts?

Offline

#62 2006-10-27 07:21:11

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

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

@saccade

Michael,
I’ve fixed this problem. Please download the plugin again and reinstall:

Beginning 0.7

Offline

#63 2006-10-27 10:58:16

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

Philip,
thank you very much – it works.

Offline

#64 2006-10-27 13:39:58

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

@Philip: thanks for answering so quick!

As you can imagine from my brutal code manipulation and not knowing the strip_tags command I am no programmer :)

Q: Why do i want a different excerpt option?
A: The simple answer is that I want pure and short text teasers for article lists.

If you take a look at my linked website, then you will see a German local news site where I only list article titles and metadata on the homepage. The 2nd level in the presentation structure are classical excerpt lists. The 3rd level are full articles.

One goal is to achieve a fast and link rich homepage. Another goal is to achieve archive transparency by using the available metadata links.

Right now the overview on the homepage is too naked. The excerpts are missing. An excerpt generator like yours gives me the chance to add some minimum text teasers to show sub-headlines and some teaser text.

I will check your one line solution and report later. Thanks again!


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#65 2006-10-27 15:35:34

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

Just came in and solved all my problems:

Rob Wilshire made an update for rss_auto_excerpt:

rss_auto_excerpt 0.2

Many new features including the following:

    * striptags attribute to remove all HTML tags from the auto excerpt
    * overrideexcerpt attribute to display auto excerpt even if one already exists for the article
    * showlinkwithexcerpt attribute to allow you to turn off the automatic link when an auto excerpt is displayed
    * skiplength, skipwords and skipparagraphs attributes to create “reverse” excerpts which display the article body except for the first x characters, words or paragraphs.

More details and an example of a “reverse” excerpt can be found in the plugin help.

http://forum.textpattern.com/viewtopic.php?pid=129755#p129755


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#66 2006-11-08 21:55:09

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

I’m using the upm_image tags. After the upgrade to 4.0.4 the beginning plugin does not work correctly together with the impages. The images cannot be found. error: upm_image: requested image(s) could not be found: “”

anybody else with this issue?

Offline

#67 2006-11-12 23:50:21

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

Something happened, I don’t know what.
Adding the newest version of the plugin to existing Sites (after updating 4.0.4) results in a broken </p>-Link (it’s “</p”) before the continue-Link.
I use the “inside”-formatting.

example:
<span class="exzerpt"> <p>Wir wollen …</p<span class="cont"><a href="http://www.evangelisch-in-neuhausen-nymphenburg.de/kvwahl2006/5/welchen-herausforderungen-wollen-wir-uns-stellen">&rarr; weiterlesen</a></span></p></span>

What could be the reason?

EDIT: For verification I tried changing the line
$clipped = substr_replace($thisarticle["excerpt"],"",-4);
in the plugin from “4” at the end to “7”
and then it worked correctly.
But I think that is probably a bad workaround.

Last edited by saccade (2006-11-13 00:00:11)

Offline

#68 2006-11-13 01:10:53

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

Further research brought the following:

In older txp-data-entries (up to 4.0.3) there are two lines and a space after each (?) excerpt in the excerpt-html-table – placed after the final </p>-Tag.
In the new entries produced txp 4.0.4 there is nothing (no “extra space”) after the final </p>-Tag.

So – if you have legacy dataentries from older txp-versions – there won’t be any solution that simply cuts off xx characters at the end of an excerpt.

I’m no php-coder, but maybe there is a simple function to find the last </p>-Tag and place the link before it? Then of course no new </p>-Tag has to be placed after it.
Or should the code first verify if the last 4 characters are a </p>-Tag and if so delete it,
if not, then check if the last 7 characters are a </p>-Tag plus double return and white space, and if so, delete them?

Last edited by saccade (2006-11-13 01:11:50)

Offline

#69 2006-11-15 05:16:28

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

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

@saccade

I’ll see if I can go ahead and create a fix for this.

However, just to let everyone know, I’d like to focus my efforts of improving this plugin toward that already done in the creation of rss_auto_excerpt since that plugin fixes many of the common problems (eg closing tags) with this plugin.

Offline

#70 2006-11-16 09:57:44

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

@philipashlock

thank you for your work with it!

I think if I condense the problem down, then it’s simply the problem to find the correct position for the tag before the last closing paragraph-tag and after any text or tags before, which could be tags too, for example </b>, spans images and links which the users want to have in their plugin. They shoould remain untouched.
And I suppose in special cases it could also be that there is a tag following the last paragraph-tag, for example a div or a span, if users provide this in their excerpt in any manner (I think it will seldom, but it could be).

So the link shouldn’t be appended together with a fixed tag, like now,
but it should be inserted in the correct position before the closing p-tag (whether generated before by generated excerpt or provided by users excerpt) – without touching the rest.

Offline

#71 2006-11-19 23:41:59

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

Now I tried to find a solution and tested it in a small plugin. I appreciate every hint or correction.

Offline

#72 2006-11-21 11:42:22

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: [plugin] [ORPHAN] Beginning (update and merge of pfa_beginning + ede_beginning)

When in debug mode, there is the following error in “beginning”:

tag_error <txp:beginning length="250" format="inside" linktext="&rarr; weiterlesen" styleclass="einladung" cfield="continue" /> -> Notice: Undefined index: continue on line 18

This has to do with the “Check for customfield”.
Is it a normal message that appears if there is no customfield defined?
Can it be ignored?

Last edited by saccade (2006-11-21 11:43:01)

Offline

Board footer

Powered by FluxBB