Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-10-14 18:49:25
- Erik Holmer
- New Member
- Registered: 2005-10-12
- Posts: 4
Give textile-functions to custom-field
I had to mod textpattern custom fields, so that I could use one as a third text-area when writing a new article. I changed the MySQL table to handle more than 255 chars, I resized the custom field I wanted, and put it on the front page under the “write”-tab.
Everything works allright, except for one thing:
The text I write into the custom field wont convert ENTER into <br /> and duble-enter into <p> and all the other things that textile does for you…
Now, is there a way to apply the “textile-function” to my custom made text-field, so that it will act just as the body and excerpt text-fields?
Last edited by zem (2005-10-15 00:23:55)
Offline
#2 2006-07-15 15:11:46
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: Give textile-functions to custom-field
Sorry folks, but I have the same question as this guy had.
The only way I can see it being done is through a plugin. upm_textile only textilises plain text, and doensn’t first “parse” containing txp tags. So this question probably goes pretty straight to Mary or any other developper. In plugins isn’t there some function that could do something like :
<code>
if ($thing) {
$foo = parse($thing); <<<<<< what would be the correct function for this?
include_once txpath.’/lib/classTextile.php’;
$textile = new Textile();
return $textile -> TextileThis($foo);
}
</code>
thanks
Last edited by guiguibonbon (2006-07-15 15:12:50)
Offline
Re: Give textile-functions to custom-field
Erik Holmer wrote:
Everything works allright, except for one thing: …
I take it that you are also aware that custom fields are not included in the search. There is a mod but, I understand that, inclusion of the fields results in slower performance.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#4 2006-07-16 01:48:47
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Give textile-functions to custom-field
Try v.0.2.
Offline
#5 2006-07-16 13:50:55
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: Give textile-functions to custom-field
So it was the correct function. Wonder why it didn’t work then. Well, I’ll try your little update. Many thanks.
Offline
#6 2007-05-09 16:48:14
- stem
- New Member
- Registered: 2004-11-02
- Posts: 6
Re: Give textile-functions to custom-field
Hi Mary,
I tested the plugin – one question: everything works fine with the plugin. I used it to let a custom flied content be textile-html. But for the table tags (|table1|table2|table3|) it does not work. Could you give me a answer on this?
Thank you for your great engagement…
Offline
#7 2007-05-10 02:02:11
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Give textile-functions to custom-field
I assume you mean by “does not work” that the input remains as entered, is not converted by Textile? Is that correct? Can you supply a sample for me to test?
Offline
#8 2007-05-10 18:04:54
- stem
- New Member
- Registered: 2004-11-02
- Posts: 6
Re: Give textile-functions to custom-field
Hi Mary, thank you for your fast reply!! Yes you are right – the textile tags are not interpreted. The thing is – just in case of tables. Other tags like emphasis strong are interpreted correctly. The tag |a|table|row| is not converted. The output is the same like the input. What strikes me is that in the normal content field the same tag works – just in the custom field there occurs this problem.
Thanks,
Stem
Offline
#9 2007-05-11 03:46:08
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Give textile-functions to custom-field
I’m afraid I can’t replicate this. I tested both entering the input to the tag directly, as well as wrapped around custom fields. Both output the expected results.
Direct:
<txp:upm_textile>|a|table|row|</txp:upm_textile>
<txp:upm_textile>|another|table|row|</txp:upm_textile>
Custom fields:
<txp:upm_textile><txp:custom_field name="custom1" /></txp:upm_textile>
<txp:upm_textile><txp:custom_field name="custom2" /></txp:upm_textile>
Output for both:
<table>
<tr>
<td>a</td>
<td>table</td>
<td>row</td>
</tr>
</table>
<table>
<tr>
<td>another</td>
<td>table</td>
<td>row</td>
</tr>
</table>
Is there any other information that might be relevant?
Offline
#10 2007-05-11 08:37:03
- stem
- New Member
- Registered: 2004-11-02
- Posts: 6
Re: Give textile-functions to custom-field
Hi Mary, thank you for your help. I found the “mistake” – the tag <txp:upm_textile> must be directly written around the custom-field request. I included a <div> inside the tag and therefore it did not function with the table – although the other tags were interpreted correctly.
Conclusion: Do not code it like this:
<txp:upm_textile>
<div id="Prod_aktion">
<txp:custom_field name="ProduktinfoFachkreis" />
</div>
</txp:upm_textile>
But like this:
<div id="Prod_aktion">
<txp:upm_textile>
<txp:custom_field name="ProduktinfoFachkreis" />
</txp:upm_textile>
</div>
Offline
Pages: 1