Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-02-05 16:35:29
- FireFusion
- Member
- Registered: 2005-05-10
- Posts: 698
Is there any plugin that can do something like this?
I want to be able to extract content from one article a place it in different parts of a form. Here is a really simple example of what I want.
The Article
<txp:content item="stuff">
h3. Blah Blah
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec ut ipsum. Maecenas suscipit dignissim
massa. Ut sagittis nisl vitae mauris. Pellentesque nec nibh suscipit sapien sollicitudin fringilla. Sed sit
amet risus in lorem ultrices varius. Aliquam erat volutpat. Quisque suscipit ornare quam. Maecenas
tempus ligula. Proin ut enim a elit pulvinar sagittis. Pellentesque aliquam molestie velit. Etiam lobortis
gravida massa. Suspendisse neque leo, consectetuer sed, iaculis eu, ornare nec, ligula. Etiam ac urna.
</txp:content>
<txp:content item="more">
h3. Blah Blah
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec ut ipsum. Maecenas suscipit dignissim
massa. Ut sagittis nisl vitae mauris. Pellentesque nec nibh suscipit sapien sollicitudin fringilla. Sed sit
amet risus in lorem ultrices varius. Aliquam erat volutpat. Quisque suscipit ornare quam. Maecenas
tempus ligula. Proin ut enim a elit pulvinar sagittis. Pellentesque aliquam molestie velit. Etiam lobortis
gravida massa. Suspendisse neque leo, consectetuer sed, iaculis eu, ornare nec, ligula. Etiam ac urna.
</txp:content>
The Form
<div id="stuff">
<txp:content_output item="stuff" />
</div>
<div id="more">
<txp:content_output item="more" />
</div>
Last edited by FireFusion (2007-02-05 16:40:20)
Offline
Re: Is there any plugin that can do something like this?
>firefusion
I want to be able to extract content from one article a place it in different parts of a form. Here is a really simple example of what I want.
So, basically you want to store static content and and access it in a form?
Why don’t you just input your content into an article, where [stuff = excerpt] and [more=body]. Then you can use a standard <txp:article/>
or <txp:article_custom/>
tag to access it.
Your call on a page template (where the article’s section and category information is passed from the URL)
<txp:article form="myForm" limit="1" />
or for a specific article…
<txp:article_custom id="X" form="myForm" />
myForm would look like:
<div id="stuff">
<h3><txp:title /></h3>
<txp:excerpt />
</div>
<div id="more">
<h3><txp:title /></h3>
<txp:body />
</div>
Did I understand you correctly?
Last edited by mrdale (2007-02-05 17:18:59)
Offline
#3 2007-02-05 17:34:55
- FireFusion
- Member
- Registered: 2005-05-10
- Posts: 698
Re: Is there any plugin that can do something like this?
Yeah, that’s the way i’ve been doing it and it’s an ok fix for some projects but for others it just isn’t. There are project where I need all the info stored in one article and i need to call lots of bits.
I think Textpattern needs something like symphony where you can set different data fields and types per section.
Thanks anyway
Offline
#4 2007-02-05 19:27:19
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Is there any plugin that can do something like this?
You could use custom fields. By default their field type is ‘varchar’, so they can contain only 255 characters. You can change that to ‘text’ to increase the character limit. Only problem left is that the size of the input areas won’t change.
Offline
#5 2007-02-05 19:28:54
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: Is there any plugin that can do something like this?
Els wrote:
Only problem left is that the size of the input areas won’t change.
That sort of prompts the question, how does one enlarge those input fields?
Cheers Martin
Offline
#6 2007-02-05 20:18:53
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Is there any plugin that can do something like this?
masa wrote:
That sort of prompts the question, how does one enlarge those input fields?
Hack function custField in txp_article.php to change input to textarea. I’ve come this far, but don’t know enough php to actually do this ;) Besides, hacking the code is not something to do lightly.
Offline
#7 2007-02-05 20:40:45
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: Is there any plugin that can do something like this?
Hey Els,
I just remebered this post by ace of dubs that might be helpful here – looks a bit intimidating but might well be worth investigating.
Offline
#8 2007-02-05 20:57:54
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Is there any plugin that can do something like this?
Fusion,
Team Textpattern can build something like this for you. Contact.
Alex
Offline
#9 2007-02-05 21:41:18
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Is there any plugin that can do something like this?
masa wrote:
I just remebered this post by ace of dubs that might be helpful here – looks a bit intimidating but might well be worth investigating.
Thanks Martin, I’ll remember that for when I really need it. I still think that hacking the code needs a very good reason, not just because ‘it would be nice’ ;) I used to have one or two – very small – hacks, but decided to let go of them when the upgrades frequency increased.
Offline