Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2006-10-31 14:05:12

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

OK. Such things happen. What I do to analyse code is to copy & paste it into a code editor to get a better overview. Sometimes I throw in loads of ‘debug’ comments to check for the expected results in the HTML output.

Thanks!!!! This allows me to use the excerpt as the title attribute of my permalinks!!!!

I see. I have to take a look at asy_wondertag. So, I did and mentioned your solution at asy_wondertag

Question: How can I duplicate a plugin?

I want two versions of rss_auto_excerpt. One stripping all tags and one which keeps the h4 intact.

Last edited by merz1 (2006-10-31 14:09:42)


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

Offline

#32 2006-10-31 16:15:11

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [plugin] [ORPHAN] rss_auto_excerpt

Question: How can I duplicate a plugin?

I want two versions of rss_auto_excerpt. One stripping all tags and one which keeps the h4 intact.

Check out ied_plugin_composer it should easily do what you are wanting.

Offline

#33 2006-11-14 22:31:26

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

@Rob

your plugin is very helpful for auto-generating excerpts.
As you might have noticed here and especially here
I’m looking for a special control over placing the read-more-link.

It should be placed inside the last line of an excerpt – regardless whether using an existing or generating an auto excerpt.

I was advised to ask you nicely – which I enjoy to do now :-)

What would help would be an attribute like ‘formatting=“inside”’ (which is e.g. provided by the Plugin Beginning)
but with a careful method of positioning correctly before all closing tags of an existing or auto-excerpt.

(the other advice honors me, and I would like very much to take the challenge – but with my deepest regret I still didn’t find enough time to learn php or anything like that, and too – I don’t want to reinvent the wheel, when I see so much of good work already in duty. And if thinking about a simple plugin “place_link_inside”, then it should at any rate be combinable with your plugin – so I estimate it’s better to think about making it a feature of your plugin from the beginning.)

So perhaps it is a small work for you (I hope so!) and it would be a great delight for me (and my clients) if you consider it useful and could find a way to add this to your plugin. :-)

best regards
Michael

Offline

#34 2006-11-15 21:13:06

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

@saccade: Michael, the more link is inside the last line of the generated excerpt. I am using on my homepage:

<div class="excerpts_home">
<txp:rss_auto_excerpt length="260" linktext="More &hellip;" 
ending="&hellip;" overrideexcerpt="1" striptags="1" linkwraptag="strong" /></div>

That results in:

<div class="excerpts_home">
<h4>sub title</h4>
Excerpt Text ... &hellip; 
<strong><a rel="bookmark" href="URL - permalink" title="text">More &hellip;</a></strong>
</div>

I didn't check the output with overrideexcerpt="0" yet.

For keeping the h4 I did a minimal change to the plugins source code.

Last edited by merz1 (2006-11-15 21:15:18)


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

Offline

#35 2006-11-15 22:03:06

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

@merz1

OK, but
striptags strips all tags, in your example the excerpt text has no tag surrounded, which is no valid html I think and will probably cause problems in the output and formatting by css.
Of course you could provide a manual fixed tag around it (surrounding the txp:rss_auto_excerpt-tag, but you will loose paragraphs within the excerpt if there are more than one. So it will not work well with existing excerpts, where users for example want certain separate paragraphs.

You are right, it should work well and to my needs with single paragraph generated excerpts.

But unfortunately not with existing excerpts.

Offline

#36 2006-11-15 23:34:32

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

The minimal change (see link 2 above) I made could not only be used to keep h4 but also every other tag like p. Maybe I will tweak the code a little more to get proper tag wrapping :)

I would simply recommend an if excerpt then output form and else use rss_auto_excerpt construct. The output form will contain the excerpt and the formatted more link as you like it. Pls. see above comment for inspiration.


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

Offline

#37 2006-11-16 06:53:54

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

@merz1

I think, every strip-tag-solution is going into the wrong direction for it will strip blindly and most surely too much, not taking into account what the user might have intended when posting his excerpt text.

could not only be used to keep h4 but also every other tag like p

Keeping the p-tag will throw the link out of the paragraph again, I suppose – and bring me back to the starting point? ;-)

The task I’m looking for is simply place the more-link at the end of the last paragraph of an existing excerpt.
And to bring a sense of the difficulty behind: This should work even if there are several nesting or successive tags at the end of the paragraph (imagine links, images, spans whatever).

if excerpt then output form … The output form will contain the excerpt and the formatted more link as you like it.

That was where I started from. There is no tag-preserving way of placing the link inside the paragraph (except with the plugin Beginning but with the problem of a fixed rough way to find the right place (simply deleting the last characters, supposing it’s the right code </p> but running into problems if it isn’t or if there are different ways of ending within one database due to different behaviour of txp-versions.))

So I think there still has to be found a way to find the correct position for the link and place it before the closing paragraph-tag of an existing excerpt – without deleting any other tag/code.
Stripping all doesn’t make sense.

Last edited by saccade (2006-11-16 07:03:49)

Offline

#38 2006-11-16 10:49:28

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

Keeping the p-tag will throw the link out of the paragraph again, I suppose – and bring me back to the starting point? ;-)

Good thinking … your point :-)

For an existing excerpt with all tags and whatever I only see two possibilities:

  1. Put the more code into the excerpt which will annoy editors (never tested that). Try to ease the pain with a keyboard shortcut.
  2. Tweak the TXP core code for the excerpt to include the more permalink at the end of the excerpt. And yes you/something will have to replace the last array of predefined content tags with the more permalink followed by the closing tags. Tricky! I.e. you don’t want to have the link in the last cell of a table which is inside a long blockqoute, don’t you?

BTW, I never had your problem because I think that the more link should be big and outstanding to attract readers to click through to the full article. Right now I only use the rss_auto_excerpt solution for an article list on the homepage where I only want a very small two-line teaser below the headline and the sub-headline. All other lists where I use the original excerpt have huge read more areas below the excerpt :)

Last edited by merz1 (2006-11-16 10:50:23)


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

Offline

#39 2006-11-19 23:40:08

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

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

Offline

#40 2006-12-22 08:03:55

jusisan
New Member
From: Helsinki, Finland
Registered: 2006-05-13
Posts: 4

Re: [plugin] [ORPHAN] rss_auto_excerpt

Hmm. I don’t know if this is something I’m doing wrong, but I have a two-column layout and the following code in a part of it:

<h1><txp:title /></h1>
<div class="column lower1">
<txp:hak_article_image />
<txp:rss_auto_excerpt paragraphs="1" overrideexcerpt="1" showlinkwithexcerpt="0" />
</div>

<div class="column lower2">
<txp:rss_auto_excerpt skipparagraphs="1" paragraphs="50" />
</div>

What I’m trying to achieve is the excerpt on the other side together with the image and the article merrily continuing on the other side: However, this does not work. The excerpt comes out just right, but the lower2-column refuses to skip the first paragraph.

Please tell me if I’m doing something wrong, or if someone knows how to remedy this.

Cheers, Jussi

Last edited by jusisan (2006-12-22 08:13:36)

Offline

Board footer

Powered by FluxBB