Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[archived] fha_reform - Simple table/list maker
Notice: This thread is archived, this plugin is no longer available.
**********************************************************
Introducing fha_reform
Download the latest version 0.2 (in old format).
This plugin will take in a simple list/table and output a properly formatted presentation according to the model specified. Please note that this is only meant to provide for simple things like tables and short data lists, i.e. there is no support for nested lists etc. The original intention was to have a structuring helper, which would let me easily view and edit my tables/lists without having to chew over XHTML tags or complex Textile markup.
Note that you can still use Textile in your data. Some issues may arise, however, because of how Textile may interact with some delimiters. In cases like that just experiment with different delimiters until you get a satisfactory result.
These parameters can be used:
- model The following values are valid: ul, ol, dl and table. When not specified, ul is used by default. This parameter defines the structure of the resulting presentation and corresponds to the respective XHTML tags. Note that for definition lists (the dl model), the first element on a line will get the dt tag, while rest will become definitions (dd). For ordered/unordered lists, each line element become a mere span.
- delimiter Any value is valid. This parameter tells the plugin how to break lines into elements. Do specify any leading/trailing spaces, if needed. The delimiter will be eventually stripped of the outputted code, i.e. it won’t appear on your page. The delimiter has to be unique throughout the whole block of data.
- headers Any value is valid. If set, the plugin will take the first line of your data as the header line and use the proper tags. Sofar this only makes sense for tables.
- class Any value is valid. If not specified, a default “fha_reform” class will be used. This parameter sets a CSS class for the top-level wrapper tag.
Any Textile markup is preserved (because it is evaluated at article create/edit time). The plugin will attempt to do some magic to the content it gets from you:
- Any email addresses are turned into active links, with their all of their parts encoded per Textpattern’s built-in functions (medium spam protection)
- Any web URLs are turned into links, too.
- You can use the ‘_custom1’ to ‘_custom9’ strings to get the current article’s custom fields; the plugin automatically replaces them with the respective values.
- The plugin attempts to convert any strings in the syntax of ‘_sometext’ (other than ‘_customX’) into language strings if possible (see the default ‘en-gb.txt’ file for examples). If no such strings is found in the current language file, the content is left as such.
- The plugin will attempt to guess the data type for each of the elements and attach a respective class to its tag. Defined classes are text, number (a number with an optional period), date (starts with a single or douhle digit, ends with a four-digit number), time (eg. “21:30”, “19:30 pm” or “6 AM”), email and web. The guessing mechanism is far from perfect, suggestions are welcome.
Some examples for the plugin:
<code><txp:fha_reform model=“table” delimiter=”. “ headers=“yes” class=“cd_listing”>
No.. Title. Duration
1. Track01. 5:23
2. Track02. 8:01
3. Track03. 4:57
</txp:fha_reform></code>
This will output a table of CD tracks with a header line (note the double period after “No” to overcome delimiter stripping).
<code><txp:fha_reform model=“dl” delimiter=”: “ class=“people”>
Name: Filip Hajny
Country: Czech Republic
City: Prague
Language: Czech
</txp:fha_reform></code>
This will output definition list of five items.
Last edited by mamash (2005-01-12 10:23:57)
Who’s gonna textdrive you home tonight?
Offline
#2 2004-10-23 17:46:49
- Remillard
- Plugin Author

- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: [archived] fha_reform - Simple table/list maker
This is pretty cool! I’ve attempted Textile tables and been somewhat successful with my resume but it took a lot of tinkering.
Out of curiosity, do you parse the items? That is, could TXP tags be included as some of the table items?
Regards,
Remillard
Offline
Re: [archived] fha_reform - Simple table/list maker
Most probably not. In the future – likely.
Who’s gonna textdrive you home tonight?
Offline
Re: [archived] fha_reform - Simple table/list maker
Wow… totally slick idea.
Justin
VC#72, waiting patiently for /section/category/article-title/ based URLs :)
Offline
Re: [archived] fha_reform - Simple table/list maker
Glad you like it.
I’m going to have to give access to a TXP installation to a few beginners, and for that purpose wanted to keep tag level in articles to the minimum. I’m talking about things like having numbers align to the right in tables (which would normally require having people to enter a class into each of the cells), or providing for simple information elements (e.g. facts about an upcoming concert).
Who’s gonna textdrive you home tonight?
Offline
Re: [archived] fha_reform - Simple table/list maker
This is the best! Just what I was looking for.
Thanks!
Jamie
Edit: The plugin refuses to install for some reason. It takes me back to /textpattern/index.php and a login/logout page? Any suggestions?
Last edited by soulship (2005-01-07 18:59:52)
Offline
Re: [archived] fha_reform - Simple table/list maker
Hi Jamie,
the plugin is in the new plugin format, i.e. cut and paste its contents into the plugin installation form in your TXP admin. I have a new version with some more features, so I’ll try to remember to pack it up, upload it and post it here in a few days (including the old format version).
Who’s gonna textdrive you home tonight?
Offline
Re: [archived] fha_reform - Simple table/list maker
OK, a new version is in (new format, old format).
Changes:
- E-mail and web URLs are automatically turned into links. E-mail address are encoded using the built-in Textpattern’s functions to protect against spam.
- New CSS classes are used if necessary: ‘email’ and ‘web’.
- Special codes (‘_customX’) can be used to retrieve current article’s respective custom field values.
- Special codes (‘_sometext’) can be used to retrieve language specific strings if any (see the default ‘en-gb.txt’ for examples).
Who’s gonna textdrive you home tonight?
Offline
Re: [archived] fha_reform - Simple table/list maker
Beautiful Mamash!
Worked like a charm. Thanks for your help and thanks for the beautifully simple to use plugin!
Jamie
Offline
#10 2005-04-30 16:05:17
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: [archived] fha_reform - Simple table/list maker
Maybe a stupid question:
But how do i make a tree collums table.
With :
<copy>
<txp:fha_reform model=“table” delimiter=”. “ headers=“yes” class=“cd_listing”>
No.. Title. Duration
1. Track01. 5:23
2. Track02. 8:01
3. Track03. 4:57
</txp:fha_reform>
</code>
I get :
No. Title Duration 1 Track01 5:23 2 Track02 8:01 3 Track03 4:57
I use RC1
Roelof
Offline
Re: [archived] fha_reform - Simple table/list maker
Hey Relof,
I just got your email. I think you need to try the simple example that mamash has included in the help file with the plugin. Try it in an article. You will need to style the output with some css to really get it to look nice. This plugin will tag your output, but the style and display will be up to you. To get a DL with your example:
txp:fha_reform model=“dl” delimiter=”. “ class=“tracks”
1. Track01. 5:23
2. Track02. 8:01
3. Track03. 4:57
</txp:fha_reform>
txp:fha_reform model=“dl” delimiter=”. “ class=“tracks”
1. Track01. 5:23
2. Track02. 8:01
3. Track03. 4:57
</txp:fha_reform>
txp:fha_reform model=“dl” delimiter=”. “ class=“tracks”
1. Track01. 5:23
2. Track02. 8:01
3. Track03. 4:57
/txp:fha_reform
I get perfect output <a href=“http://studioqphotography.com/”>here</a>
Also, double check and make sure that you have the plugin turned on. Under admin / plugins/ and make sure that fha_reform is enabled. default is no change it to yes
Then you will need to updae your css to style the class “tracks” or whatever you name it.
Last edited by soulship (2005-04-30 17:16:25)
Offline
#12 2005-04-30 17:28:53
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: [archived] fha_reform - Simple table/list maker
oke,
The model=“dl” is not a problem.
I get this wierd output when i use model=“table”
And when i do :
<code>
<txp:fha_reform model=
Last edited by roelof (2005-04-30 17:46:39)
Offline