Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2008-01-31 05:46:08
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Stuart
Sorry, it doesn’t currently do what you want — it only gets/tests data via a known name.
I’ll think about putting an iterator in for name-value pairs that will operate in a similar way to the new sed_pcf_for_each_value tag.
— Steve
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
OK, thanks anyway. If you find the time to add that later I’d find it really useful.
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Hello Steve
I abandoned the previous search, but I have a new problem! I’m trying to use sed_pcf_for_each_value, but so far I’ve not been able to output anything.
I have an article which contains 4 valid article IDs in a custom field called related-article-IDs. In my article form I have
<txp:sed_pcf_for_each_value name="related-article-IDs"><txp:article_custom id="{value}" form="article_nav" /></txp:sed_pcf_for_each_value>
and in the article_nav form
<li><a rel="bookmark" title="read full article" href="<txp:permlink />"><txp:title /></a></li>
One thing I’m not sure of in the help, is that for sed_pcf_for_each_value you specify an attribute called ‘name’ to hold the custom field to access, whereas in the other tags you’ve used ‘custom’ as the attribute. Is that deliberate? I’ve tried both just incase, but no luck yet.
Hopefully I’m doing something obviously wrong. Any help appreciated.
cheers
Stu
ps. there’s a typo there too:
3. As an enclosing tag… <txp:sed_pcf_for_each_value>... your stuff here...<txp:sed_pcf_for_each_value />
the trailing slash should be at the start of the closing tag I think…
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
- the custom field holds a simple, comma separated string
16,18,20,21 - the txp:sed_pcf_for_each_value code isn’t written an article form, but pulled from another form which is called with the
txp:output_formtag, so I don’t think it’s an issue with articles within articles. I’ll investigate this further though just incase
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Steve
Only just got round to trying this excellent plugin out. I was getting close to running out of custom fields and this has saved the day, woohoo!
Couple of things I spotted with v0.3.108:
- It doesn’t mention that you need sed_plugin_library in the docs as far as I can see
- When I did install the library, the plugin still failed with an invalid call to sed_lib_extract_packed_variable_section(). Looks like you’re intending to rename the functions in a later version of the library(?) I grabbed v0.2 from your site so, unless I missed something, I manually renamed the function calls for now
- Might be worth mentioning that the custom field names should be all lower case (i.e. if the field was defined as
My Fieldyou requirecustom="my field"in the plugin. It may even be"my-field", I don’t know). I’m not entirely sure but I think this automatic lower-casing behaviour occurred in 4.0.5 or 4.0.6 cos it caught me out in my plugins
Anyway, kudos to you yet again. Another blinding plugin. Many thanks.
Last edited by Bloke (2008-03-01 20:01:41)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#21 2008-03-01 20:15:49
- candyman
- Member

- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
I’d like to have custom fields related to the forms, eg:
Forms: Film review
Book-related fields: Title, Director, Actors, Kind of support (DVD, VHS…)
Form: Book review
Book-related fields: Title, Author, Editor, N° of pages…
And so on…
How can I make them appear accordingly to the forms I like? Maybe with this plugin can I obtain this?
How it should be the code for many some book-related fields, for example?
Thnaks in advance.
Last edited by candyman (2008-03-01 20:17:48)
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
candyman wrote:
I’d like to have custom fields related to the forms, eg:
Not quite related to forms as such, but if you pack your book-related fields into one custom field and your film-related fields into a second custom field, and put your film review articles in a different TXP section to your book review articles, you could use sed_section_fields to display the relevant custom field in the back-end.
If you pack your custom fields like this:
meta(title='Our story';author='Him';editor='Me';pages='42')
on the public side you could have some conditional logic in the form that displays your articles like:
<txp:if_section name="book_reviews">
Author: <txp:sed_pcf custom="books" section="meta" variable="author" />
...
<txp:else />
Director: <txp:sed_pcf custom="books" section="meta" variable="director" />
...
</txp:if_section>
There are probably better ways of doing it, but does that help at all?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#23 2008-03-02 09:29:55
- candyman
- Member

- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Thank you Bloke but, I haven’t understand some steps.
I’m trying to get a multi author blog with different sections. One section is film review, another is book review and the last one is music review.
I created the sections named cinema, book and music in order to have, for example, the following kind of urls:
I created many custom fields with the glz_custom_fields plugin in order to obtain more custom fields than 10 and to use some radio buttons (for the rating) and so on, like:
Author
Director
N° of pages
N° of minutes
N° of tracks
rating
etc…
Then I, think, I should use the sed_section_fields plugin to make appear in the write tab only the fields useful to the relative section.
For example: when I use the “cinema form” I’ll make appear the Director, N° of minutes and the rating only and NOT, for example, the N° of pages (that should appear instead, with the rating and the Author fields, when I use the “book form”).
So, I’d like to know if, using the sed_pcf: Packed Custom Fields plugin, should be a good idea. May this plugin can avoid the use of different forms?
I haven’t understood the use of packaged custom fields like:
meta(title=‘Our story’;author=‘Him’;editor=‘Me’;pages=‘42’)
Where should I specify them? I’ve read the documentation but I haven’t understood the way.
Thanks in advance for all your help.
Last edited by candyman (2008-03-02 09:37:30)
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
candyman
Your approach sounds great and very logical.
sed_pcf is used for packing more data into a custom field than just one item. Normally one custom field = one “thing”, like Director, No of Pages, etc. This plugin’s only really of use if you use custom fields a lot and you don’t use any other plugin to extend the built-in limit of 10. It sounds that if you are using glz_custom_fields to obtain more than 10 (I didn’t know it did that as well!) then sed_pcf is not necessary.
But if you do decide to pack more than one “type” of information into a single custom field, this is how you do it:
- Decide on a name for your custom field; something that is generic enough to encapsulate all the data you want to put in it. So, taking the “film review” example, instead of having separate custom fields for No of Pages, No of Minutes, No of Tracks, you could pack them into a single custom field called “Duration” or “Quantity” or something like that (I’ll choose “Quantity” for this example)
- In each Film Review article, populate the custom field called “Quantity” with data like this:
pages(num='92')|mins(num='126')|tracks(num='8'). There are a variety of ways of specifying the data inside a custom field, detailed in the sed_pcf help. So an alternative might be:info(pages='92';mins='126';tracks='8'). Parts of a custom field separated by ‘|’ characters are called “sections” (a trifle confusing :-) and anything to the left of an ‘=’ is called a “variable” - In your forms, you “extract” information from within a given custom field. If you use the 1st syntax from step 2 you would pull out the running time of the film like this:
<txp:sed_pcf custom="quantity" section="mins" variable="num" />. That would display126. If you chose the 2nd format you would use:<txp:sed_pcf custom="quantity" section="info" variable="mins" />
So you see it is rather flexible and is limited only by how much information you want to “pack” into each custom field. There is a third “simple” syntax which is just a comma-separated list: 92,126,8. I’ve not used that one yet so I’m not sure how easy it is to get at the data; I suspect it is solely for iterating over the contents of the custom field using sed_pcf_for_each but I’m not sure. And there are also “if” tags in the plugin so you can take action depending if a custom field contains a certain variable or section, which may reduce the number of forms a little.
Like I say, if you’re using glz_custom_fields then you probably don’t need sed_pcf.
Is that any clearer?
Last edited by Bloke (2008-03-02 10:45:00)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#25 2008-03-02 11:07:24
- candyman
- Member

- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Perfectly clear, you’re a natural born teacher! ;)
Well, I think that my approach should work but you’re right: I need an extra plugin to break the 10 custom fileds limit.
I think I’ll give a try to the sed_pcf anyway just to establish a Guinness World Record by number of plugins used with TXP… ;)
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
I do not understand what I am doing wrong. I have comma separated values in my custom1 field (named YouTubeV=) and I keep getting the following error: Returning early – nothing to do in CF[YouTubeV=].
I have a page with the following:
<txp:article form=“art” />
The Art form is:
<txp:if_article_list>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:else />
<h3><txp:title /></h3>
<div id=“thumbs”>
<txp:hak_article_thumb linktype=“page” link=“1” linktitle=“txp:alt” />
<txp:sed_pcf_for_each_value name=“YouTubeV=” debug=“1” />
</div>
<div id=“image_box”>
<txp:hak_article_image form=“art_image” urloverride=“1” limit=“1” linktitle=“view image” />
</div>
</txp:if_article_list>
I have two articles… both of have values in the YouTubeV= custom field.
Article 1 has: UcKqyn-gUbY,PzyAP4zLb6w,90mj79GqWhc,B5MkpzMAOZM,V-TGxJI4JwA
Ariticle 2 has: red,green,blue,orange,purple,yellow
I am using TXP 4.0.6
I read Bloke’s post that mentioned the sed_plugin_library, so I installed it as well. Still doesn’t return anything.
Thanks to anyone who can help!
Last edited by photonomad (2008-08-02 22:04:07)
Offline
#27 2008-08-03 01:29:30
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
photonomad
Could you try getting rid of the “=” in the field title; just call it “YouTubeV” instead. Does that make a difference?
— Steve
Offline
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Net-Carver — Your reply helped me figure it out. Actually, the capital letters in “YouTubeV=” (not the “=”) were the problem. I made the custom field name lowercase “youtubev=” and it works perfectly now.
This is a very helpful plugin. Thanks for all of your work!
Offline
#29 2011-02-09 17:34:59
- oyster
- New Member
- Registered: 2010-11-01
- Posts: 5
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Hi
Thanks for the great plugin.
I have been using the plugin to list product features and applications. Is there a way to change the , (coma) to something else like *
to separate the lines?
from a,b,c
to a*b*c
this is how I implement the fields in the pages:
<txp:sed_pcf_for_each_value name=“features” wraptag=“ul” break=“li” />
The problem is that the coma is very common and when used it will split the features and application text.
Any help is appreciated.
Offline
#30 2016-08-24 16:54:50
- dorka
- Member
- Registered: 2012-10-04
- Posts: 90
Re: [plugin] [ORPHAN] sed_pcf: Packed Custom Fields.
Hi guys, any idea where can I download sed_pcf plugin? Thanks!
Offline