Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#253 2014-10-01 07:38:37
- alivato
- Member
- Registered: 2011-03-31
- Posts: 151
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
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
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
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
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|…">
<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
#261 2016-02-17 20:46:36
Re: [plugin] [ORPHAN] rss_auto_excerpt
As far as I remember, custom field names should not have spaces in them, but if you want the custom field labels to be different in the write panel, you can use bot_cf_titles.
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?
rss_auto_excerpt uses a valid value of $thisarticle[…]);
, so etc’s code outputs all the possible candidates you can use.
You might also want to try mkp_excerpt which is billed as a new version of rss_auto_excerpt, although I’m not sure what the difference is (Michael Pate is active on the forum, so he may pipe in here with an answer).
TXP Builders – finely-crafted code, design and txp
Offline
#262 2016-03-01 13:18:26
- MatthijsR
- New Member
- Registered: 2016-01-18
- Posts: 5
Re: [plugin] [ORPHAN] rss_auto_excerpt
jakob wrote #297893:
As far as I remember, custom field names should not have spaces in them, but if you want the custom field labels to be different in the write panel, you can use bot_cf_titles.
rss_auto_excerpt uses a valid value of
$thisarticle[…]);
, so etc’s code outputs all the possible candidates you can use.You might also want to try mkp_excerpt which is billed as a new version of rss_auto_excerpt, although I’m not sure what the difference is (Michael Pate is active on the forum, so he may pipe in here with an answer).
Thanks for your reply. I’m going to swap the spaces in my custom fields names with “_” and give bot_cf_titles a go. Thanks. I’ll let you know about the end result.
Offline
#263 2017-04-10 09:41:57
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: [plugin] [ORPHAN] rss_auto_excerpt
i know the plugin is orphan, but maybe somebody could still help me.
code (not full) i’m using in article form :
...<txp:rss_auto_excerpt words="20" ending=" […]" showlinkwithexcerpt="1" linktext="Read more" linkwraptag="p" linkclass="more" body="body" overrideexcerpt="1" showlinkwithbody="0" />...
the problem is in image code. if i insert image code into article (inside first 20 words) that way:
<txp:images id="60" form="single" />
form single:
<span class="single-img">
<img src="<txp:image_url />" title='<txp:image_info type="caption" />' />
<span style="width: <txp:image_info type="w" />px;" class="thumb-alt"><txp:image_info type="caption" /></span>
</span>
i get this error:
Tag error: -> Notice: Undefined offset: 0 while parsing form None on page default_est
textpattern/lib/txplib_misc.php:4479 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()
Tag error: -> Notice: Undefined offset: -1 while parsing form None on page default_est
textpattern/lib/txplib_misc.php:4479 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()
Tag error: -> Notice: Undefined offset: -1 while parsing form None on page default_est
textpattern/lib/txplib_misc.php:4479 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()
Tag error: -> Notice: Undefined offset: -1 while parsing form None on page default_est
textpattern/lib/txplib_misc.php:4479 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()
Tag error: -> Notice: Undefined offset: 3 while parsing form None on page default_est
textpattern/lib/txplib_misc.php:4479 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()
Tag error: <txp:/> -> Textpattern Warning: tag does not exist while parsing form None on page default_est
textpattern/lib/txplib_publish.php:521 trigger_error()
textpattern/lib/txplib_publish.php:463 processTags()
textpattern/lib/txplib_misc.php:4479 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()
Tag error: -> Notice: Undefined offset: 4 while parsing form None on page default_est
textpattern/lib/txplib_misc.php:4479 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()
if i insert the same image like this !http://www.lmno.ee/images/60.png!
– no errors.
Last edited by Gallex (2017-04-10 11:14:54)
Offline
#264 2017-04-10 12:17:41
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,310
Re: [plugin] [ORPHAN] rss_auto_excerpt
Gallex wrote #305283:
Tag error:
<txp:/>
-> Textpattern Warning: tag does not exist
Can you have a look please where this might come from?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline