Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Create an editable table with two columns, productname and price
Hi Everybody,
First of all Textpattern is great and I’m a silly designer struggling with it.
I’m not sure if this is a dumb question, somebody must have done this before.
But I can’t seem to find the solution. I browsed the FAQ’s in this Forum though.
All I want to create is a simple table which would be editable by my client herself.
And she’s no HTML-person if you know what I mean :) !
You can watch the low-tech version I allready created on the following page:
http://www.beautycentermariannegrande.nl/htm/prijzen.htm
Any help is much appreciated!
Last edited by Joranovski (2005-11-28 20:15:42)
Offline
#2 2005-11-28 20:51:01
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Create an editable table with two columns, productname and price
What about something like this?
Every product is an article. Product name is the article title, price is, for example, a custom field (named ‘price’).
Article form ‘tablerow’:
<code>
<tr><td><txp:title /></td><td><txp:custom_field name=“price” /></td></tr>
</code>
Another form ‘table’ (type: misc):
<code>
<table>
<tr><td>Product name</td><td>Price</td></tr>
<txp:article form=“tablerow” />
</table>
</code>
On the page:
<code>
<txp:output_form form=“table” />
</code>
You can style the table in the CSS.
You might have to use txp:article_custom instead of txp:article if the products are in different sections/categories.
Offline
Re: Create an editable table with two columns, productname and price
Hi doggiez,
Very kind of you to help me out!
And guess what it works like a charm!
Thanks a lot when I’m finished with styling it with css, I’ll show you the final result.
(en grappig dat juist een nederlander me helpt! ;)
Offline
#4 2005-11-28 21:25:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Create an editable table with two columns, productname and price
Graag gedaan :) And glad it works, had not tried this myself before.
Offline
Re: Create an editable table with two columns, productname and price
Hi Doggiez,
The only problem I now encounter is the fact that only a maximum of ten table rows are visible.
I’ve searched like a madman, but can’t find a limit which says a maximum of only ten articles.
Maybe for You it’s a piece of cake!
Last edited by Joranovski (2005-11-29 18:33:13)
Offline
Re: Create an editable table with two columns, productname and price
Hi Anyone, especially doggiez!
I found the solution, I added a limit=“26” to the <txp:article form=“tablerow” limit=“26” />
Thanx anyway!
Offline
#7 2005-11-29 21:43:50
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Create an editable table with two columns, productname and price
Sorry I wasn’t here to answer in time ;) But remember that if the number of articles exceeds this limit, everything your client will add won’t show in the table!
Offline
Re: Create an editable table with two columns, productname and price
Your absolutely right, I will make it 99, so it won’t happen easily
As promised the final result
http://www.beautycentermariannegrande.nl/htm/txp/index.php
Two different tables, hiding and showing through a little javascript.
Both tables use the <txp:title /> and <txp:custom_field /> tags to full effect.
I hope my customer likes it!
Thanx for all the help!
Last edited by Joranovski (2005-11-29 21:51:45)
Offline
#9 2005-11-29 21:54:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Create an editable table with two columns, productname and price
That’s very nice!
(Use < code > < /code > tags without the spaces to display code here.)
Offline