Textpattern CMS support forum

You are not logged in. Register | Login | Help

#251 2013-08-19 19:47:30

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 1,526
Website

Re: [plugin] [ORPHAN] rss_auto_excerpt

Yes thanks… i hadn’t noticed that opening <p> tag!


…. texted postive

Offline

#252 2014-06-01 07:12:39

peterj
Member
From: Melbourne, Australia
Registered: 2005-06-02
Posts: 37

Re: [plugin] [ORPHAN] rss_auto_excerpt

Quick fix to stop the “keep reading” link generating when showlinkwithbody=“0” and when RSS_auto_excerpt is as long as the body.

If using paragraphs, change line 45 to.

$pghcount = count(explode("</p>", $body))-1;

The paragraph count returns one more than there actually are so rather than work out why.. I’ve just subtracted one. Similar may work for sentances.

Offline

#253 2014-10-01 07:38:37

alivato
Member
Registered: 2011-03-31
Posts: 147

Re: [plugin] [ORPHAN] rss_auto_excerpt

What if the first tag in the article picture <p><img style =“float…
No picture is displayed
?

Offline

#254 2014-10-01 15:30:35

etc
Developer
Registered: 2010-11-11
Posts: 3,401
Website

Re: [plugin] [ORPHAN] rss_auto_excerpt

alivato wrote #284396:

What if the first tag in the article picture <p><img style =“float…
No picture is displayed
?

Is this of any help?

Offline

#255 2016-01-28 18:42:36

mFrance
New Member
Registered: 2014-08-01
Posts: 6

Re: [plugin] [ORPHAN] rss_auto_excerpt

Hello!
This tag: <txp:etc_query data=’<txp:body />’ query=“p[position()<3]” /> displayed the first two paragraphs – it is right.

This tag: <txp:etc_query data=’<txp:body />’ query=‘string(p[position()<3])’ /> – displayed only one first paragraph.

What to do? We need the first two paragraphs and “string”…

Offline

#256 2016-01-28 22:14:58

etc
Developer
Registered: 2010-11-11
Posts: 3,401
Website

Re: [plugin] [ORPHAN] rss_auto_excerpt

mFrance wrote #297608:

This tag: <txp:etc_query data=’<txp:body />’ query=‘string(p[position()<3])’ /> – displayed only one first paragraph.

What to do? We need the first two paragraphs and “string”…

Because XPath string function applies only to the first matched node. You can try query="p[position()<3]/text()" instead (untested).

Edit: and this should work as you intend:

<txp:etc_query data='<txp:body />' query="p[position()<3]">
	{string()}
</txp:etc_query>

Last edited by etc (2016-02-01 13:12:23)

Offline

#257 2016-02-11 13:55:12

MatthijsR
New Member
Registered: 2016-01-18
Posts: 5

Re: [plugin] [ORPHAN] rss_auto_excerpt

Hi guys,

I can’t get the parameter excerpt=”“ to work with a custom field I created with glz_custom_fields.

This is my code:
<txp:rss_auto_excerpt length=“250” linkwraptag=”“ linktext=”“ striptags=“1” excerpt=“custom_38_set” />

I’ve tried different ways to refer to the custom field:
custom-38, custom_38, the label name … nothing works. I’ve even changed the name of the custom field in the database to a single word and tried that, didn’t work. I also tried different custom fields and a custom_field within the first 10 (standard) custom fields. No results so far.

Right now it seems that the excerpt=”“ option just doesn’t work for custom fields (it does work with title i.e.).

Any ideas?

Thx a million!

Last edited by MatthijsR (2016-02-11 14:23:01)

Offline

#258 2016-02-11 16:40:48

etc
Developer
Registered: 2010-11-11
Posts: 3,401
Website

Re: [plugin] [ORPHAN] rss_auto_excerpt

Hi, welcome to the forum.

The excerpt attribute pulls its data from the global $thisarticle array. Try to output

<txp:php>
global $thisarticle;
print_r($thisarticle);
</txp:php>

to see in which field (if any) your custom data is stored. Normally, if you give some_name to one of custom_1,...,custom_10 fields, then $thisarticle['some_name'] is set, and excerpt="some_name" should work.

Offline

#259 2016-02-11 21:29:53

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,582
Website

Re: [plugin] [ORPHAN] rss_auto_excerpt

MatthijsR wrote #297827:

Any ideas?

If I’ve understood you correctly that you want custom field 38 (whatever you called it) to be the excerpt with no html and no longer than 250 chars, you could use smd_wrap instead. Something like example 7 in the docs. For example:

<txp:smd_wrap_all wraptag="p" class="excerpt" transform="strip_tags, cut|250|33w|&hellip;">
  <txp:custom_field name="some_name" />
</txp:smd_wrap_all>

That gives you 250 chars with additional truncation to 33 words if split mid-word and adds an afterwards, all wrapped in <p class="excerpt">…</p>.

You should use the own name you specified for custom field 38 for the attribute.


TXP Builders – finely-crafted code, design and txp

Offline

#260 2016-02-17 10:09:57

MatthijsR
New Member
Registered: 2016-01-18
Posts: 5

Re: [plugin] [ORPHAN] rss_auto_excerpt

Thanks etc:

I’ve named my custom fields like this: Intro title, Intro background, without the ‘_’ to make it more user friendly towards my clients. When I changed the name of a custom field in my database (where they are marked as custom_set_38 i.e.) and used that name in the parameter it didn’t work either. Maybe the rss_auto_excerpt plugin doesn’t use the database name but the names that pop up with that PHP code you gave me? I could try it out changing one custom fields name in the glz_custom_field plugin page.

Thanks jakob:
I’m definitely going to try it out. I’ve read about smd_wrap a couple of times but haven’t checked it out completely.

Thx guys!

Offline

Board footer

Powered by FluxBB