Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2006-10-27 15:43:14

Prax
Member
From: Huntsville, AL
Registered: 2006-09-27
Posts: 24

Re: [plugin] [ORPHAN] rss_auto_excerpt

Woo! Thanks for the new features Rob!

Offline

#26 2006-10-30 00:56:45

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

I think I found a small bug, but I’m not fur shur. It seems that when there is a mix of articles, some with and some without user created excerpts there is a conflict.

Here is a snip from the article form in question.

<div class=“ex”>
<txp:article_image thumbnail=“1” />
<!—excerpt code—>
<h4><txp:title /></h4><txp:rss_auto_excerpt linktext=“Read more” linkclass=“read-all” length=“180” overrideexcerpt=“1” striptags=“1” />

OK so this is the problem. On preexisting articles in the db that already have an excerpt this works a charm. For any new articles that have a blank excerpt the article thumbnail does not show and the plugin generated “read more” link does not show. If however I type in even just one character into the excerpt box for those new articles all works well, and as expected.

Also, if the article text count does not meet or exceed the length attribute used, the plugin does not work and generates a borked excerpt.

Last edited by soulship (2006-10-30 00:58:08)

Offline

#27 2006-10-30 14:16:36

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

@soulship: I can’t confirm the error. I have articles with and without excerpts and rss_auto_excerpt works fine. As posted above my rss_auto_excerpt tag is:

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

As you see I am also using length=, overrideexcerpt=“1” and striptags=“1”.

You may check my site. Article “St. Georg, Hamburg: Internet Kamera von Philips” (25.10.06) has no excerpt and most of the others have. You can se if an article has an excerpt or not by viewing the category view. Articles with an excerpt have a huge ‘weiter lesen:’ link and icon.

Are you using (wrapping) if-excerpt conditions somewhere in this context?

Last edited by merz1 (2006-10-30 14:17:02)


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

Offline

#28 2006-10-30 20:40:45

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

I am using if_excerpt. To wrap the tag as a matter of fact…. Well here’s my form.

<txp:if_excerpt>
<div class="ex">
<txp:hak_article_thumb limit="1" link="1" linktype="image" popup="0" rel="lightbox" />
<!-- excerpt code-->
<h4><txp:title /></h4><txp:rss_auto_excerpt linktext="Read more" linkclass="read-all" length="180" overrideexcerpt="1" striptags="1" />
<!--<span class="readme"><txp:permlink>read more...</txp:permlink></span>-->

<div class="divider"></div><!--end class divider-->
</div><!--end div ex-->
<txp:else />.....

[EDIT: to shorten post and fix lazy code pasting :) ]

Last edited by soulship (2006-10-31 11:59:40)

Offline

#29 2006-10-31 02:25:08

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

Shortened for better understanding.

<txp:if_excerpt>
<txp:rss_auto_excerpt />
<txp:else />.....

But you know that the code between txp:if_excerpt and txp:else will only be executed when there is an excerpt?

That exactly was the reason why I was asking. If you put all the code after the txp:else only then it will work if there is no excerpt.

<txp:if_excerpt>
Code for the 'if there is an excerpt' goes here. 
    i.e. <txp:excerpt> will print the existing excerpt
    or <txp:rss_auto_excerpt overrideexcerpt="1"/> will create excerpt from body.

If there is NO excerpt this part will NEVER be executed!

<txp:else />

Code for the 'if there is NO excerpt' goes here. 
    That's your 'empty' case!
    i.e. <txp:rss_auto_excerpt /> will create excerpt from body.
<txp:if_excerpt />

txp:rss_auto_excerpt per default makes the decision by itself. That’s what the overrideexcerpt=“0” or “1” is for. 1 will NOT use the excerpt, 0 will use the excerpt if there is one.

Your code would be:

<div class="ex">
<txp:hak_article_thumb limit="1" link="1" linktype="image" popup="0" rel="lightbox" />
<!— excerpt code—>
<h4><txp:title /></h4><txp:rss_auto_excerpt linkclass="read-all" length="180" overrideexcerpt="1" striptags="1" linkclass="read-all" length="180" linktext="read more…" />
<div class="divider"></div><!—end class divider—>
</div><!—end div ex—>

If you want “read more…” in an extra paragraph you need to add linkwraptag=“p”.

If you want you can wrap a permlink around txp:title as people are used to click on titles but that’s pure cosmetic regarding our problem.

BTW: Code in bigger blocks is Textile coded bc.. (double dot) followed by a p. (one dot) after the quote. Why am I telling this? Because I had to correct all quotes from your code when pasting it :-)

Last edited by merz1 (2006-10-31 02:54:49)


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

Offline

#30 2006-10-31 11:53:58

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

Re: [plugin] [ORPHAN] rss_auto_excerpt

merz1 wrote:

But you know that the code between txp:if_excerpt and txp:else will only be executed when there is an excerpt?

:-) !!!! DUH !!! Yes I do so I’m not sure why I was overlooking that. Staring at it too long I guess. So thanks for the wake-up spash of water. I have been working on this site redo for about 8 days straight so I must be getting burnt out.

So now I just have:

<txp:if_article_list>
<div class="ex">
<txp:hak_article_thumb limit="1" link="1" linktype="image" popup="0" rel="lightbox" />
<!— excerpt code—>
<h4><txp:title /></h4><txp:rss_auto_excerpt linkclass="read-all" length="180" overrideexcerpt="1" striptags="1" linkclass="read-all" length="180" linktext="read more…" />
<div class="divider"></div><!—end class divider—>
</div><!—end div ex—>
<txp:else>

And all is right with the world finally :)

merz1 wrote:

If you want you can wrap a permlink around txp:title as people are used to click on titles but that’s pure cosmetic regarding our problem.

I already took care of that, but it’s higher up in that article form so I didn’t bother pasting it..

<h2 class="posttitle">
<txp:asy_wondertag>
<txp:permlink class="perm" title="
<txp:rss_auto_excerpt length="150" linktext="" linkwraptag="" showlinkwithexcerpt="0" overrideexcerpt="1" striptags="1" />"><txp:title /></txp:permlink>
</txp:asy_wondertag>
</h2>

So thanks so much for waking me up and pointing me in the right direction for my silly overlooking of a basic!

Last edited by soulship (2006-10-31 12:18:51)

Offline

#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: 517

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: 517

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

Board footer

Powered by FluxBB