Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-04-25 18:45:11
- mscwd
- Member
- Registered: 2005-06-28
- Posts: 13
Adding additional fields to an article
I’m fairly new to textpattern but am determined to master it! I am currently implementing an online arcade games/news site into textpattern and have a few questions I need answering. Basically whether or not my ideas are possible.
1. Is there a way to add additional fields to an article? Basically i’d add the flash game in the main article content, write a brief description in the excerpt maybe, however would there be a way to add other textareas within the “write article” page which could handle (game controls), (game objective) etc?
This is what I am trying to achieve, on the games page I have for arguments sake (main article DIV), (game controls DIV) and (games objective DIV). In textpatterns “write article” page I want 3 text areas to correspond to each DIV so when I go to add content into the textareas it will be displayed in their correpsonding DIV.
Otherwise I would need to insert the whole pages xhtml, so the main article content includes everything on the page; which while not a problem would be a little more difficult as i’d need to create each new game page in a dreamweaver template then copy and paste the code into the “write article” page.
I hope I havent confused you too much, and thanks for your time,
-mscwd
Offline
#2 2006-04-25 19:43:25
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Adding additional fields to an article
Possible? Yes (a plugin and/or mod could do this). An existing packaged solution? No.
Last edited by Mary (2006-04-25 19:43:50)
Offline
#3 2006-04-25 19:49:44
- mscwd
- Member
- Registered: 2005-06-28
- Posts: 13
Re: Adding additional fields to an article
Would it involve changing the txp database in anyway? Or would you need to be an expert at PHP ;)
Either way I think i’ll just have to insert the whole pages xhtml into the main article content rather than break it up. However if anyone knows any easy workaround to this problem please let me know!
Thanks,
-mscwd
Offline
#4 2006-04-25 20:16:29
- mscwd
- Member
- Registered: 2005-06-28
- Posts: 13
Re: Adding additional fields to an article
Having read a few other posts on here, would custom fields be able to do what I want? I’ve read the textBook entry but i’m left not really knowing.
Offline
#5 2006-04-25 20:31:56
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Adding additional fields to an article
You’d need to modify the database, either modifying the textpattern table or creating a new table, as well as creating the PHP to power it. Custom fields have a limit of 255 characters, I’m afraid.
Yes, don’t forget you can easily make use of headings within your articles to separate the various parts.
Offline
#6 2006-04-26 10:17:22
- mscwd
- Member
- Registered: 2005-06-28
- Posts: 13
Re: Adding additional fields to an article
What do you mean by using headings to seperate the article content? You would still need to insert all the xhtml to get that effect wont you?
Mary wrote:
Yes, don’t forget you can easily make use of headings within your articles to separate the various parts.
Offline
Re: Adding additional fields to an article
I think what Mary is saying…. it would be much easier if you just need a few extra containers in your article is the make the divisions right in the article itself:
<code>
<div class=“game”>
<h2>Game</h2>
……………game content here……………..
</div>
<div class=“controls”>
<h2>Controls</h2>
……………..controls content here……………….
</div>
<div class=“objectives”>
<h2>Objectives</h2>
……………….objectives content here………………..
</div></code>
Just don’t forget to double space the div containers to escape them from being textiled.
Last edited by soulship (2006-04-26 11:26:20)
Offline
#8 2006-04-26 16:06:31
- mscwd
- Member
- Registered: 2005-06-28
- Posts: 13
Re: Adding additional fields to an article
Thanks soulship,
Thats the route I was thinking about taking by saying i’d enter the complete pages xhtml into the article content.
I was just wondering whether they’d be a slightly easier way of splitting the article into different DIVs. Mainly because I wanted to display a google advert half way down the page, like this:
<div class="game">
<h2>Game</h2>
...............game content here…..............
</div>
<div class="GoogleAd">
<h2>Google Advert</h2>
...............Google Advert Here…..............
</div>
<div class="controls">
<h2>Controls</h2>
................controls content here…................
</div>
<div class="objectives">
<h2>Objectives</h2>
...................objectives content here….................
</div>
However I dont think that’ll prove too difficult each time i add a game so i’ll have to go down that route.
So if theres no other suggestions, thanks for your time.
-mscwd
NOTE: my above post is messed up as I dont know how to post code on these forums without it actually being used!
(edited to display code properly. -Els)
(Thanks for editing. -mscwd ;) )
Last edited by mscwd (2006-04-26 18:30:55)
Offline
#9 2006-04-26 16:31:41
- KurtRaschke
- Plugin Author
- Registered: 2004-05-16
- Posts: 275
Re: Adding additional fields to an article
http://textpattern.com/faq/43/how-do-i-post-tags-and-code-on-the-forum
kurt@kurtraschke.com
Offline
#10 2006-04-27 03:06:11
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Adding additional fields to an article
For your Google advert, what you can do is paste the code for it into a form, then call this form from your article, i.e: <txp:output_form form="google_ad" />
.
Offline
#11 2006-04-27 09:44:05
- mscwd
- Member
- Registered: 2005-06-28
- Posts: 13
Re: Adding additional fields to an article
Ok great, Textpattern seems to fit my needs pretty nicely. Thanks very much for all your help it is really appreciated.
Thanks,
-mscwd
Last edited by mscwd (2006-04-27 12:36:44)
Offline
Pages: 1