Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: One Page, different content using forms
So where would I put the <txp:title /> and <txp:body /> tags? I’m really not that good with coding, if you could dumb it down and be very precise that would be greatly appreciated!
Offline
#14 2013-08-06 13:02:21
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: One Page, different content using forms
Well, everything depends on the output you desire, doesn’t it?
I’d propose you just begin throwing the two mentioned tags into your form (or some more from the article tags category), watch how these change your page output, and try grasping how TXP works at that point.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: One Page, different content using forms
Well, the code I have in there already gives out what I want it to, and looks fine, the problem I am having is the code on the main page isn’t loading the form it should be loading when I am in the android section.
So when I am at the home page: http://glaciergaming.co.uk/blog
The default form is loaded, when I go to:
http://glaciergaming.co.uk/blog/android
It shoudl load the “android” form, but it doesn’t load any thing
Offline
#16 2013-08-06 16:18:49
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: One Page, different content using forms
SPKuja wrote:
It shoudl load the “android” form, but it doesn’t load any thing
You have an article tag on your page that, in order to display something, needed contents that you don’t give it. Instead you’ve put another article tag inside the form. You either build a form android with the tags you need. Or you try changing the code on your page template so that <txp:article form="android" />
becomes <txp:output_form form="android" />
and see what happens. The latter is another valid possibility to connect the page with the form “android”.
But as you have an article_custom tag with an unspecified form attribute the output then depends on what you have inside your default form, the one that’s always queried when no specific form is declared. That might be what you’re after but it also could be too restricting or cause more false/undesired output, we can’t know.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: One Page, different content using forms
All working perfectly now! I changed the code to:
<txp:if_section name="">
<txp:output_form form="all_news" />
</txp:if_section>
<txp:if_section name="android">
<txp:output_form form="android" />
</txp:if_section>
Thank you every one for all your help, it works just like I needed, and will reduce the ammount of pages I need to make!
Offline
#18 2013-08-07 14:23:50
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: One Page, different content using forms
Glad that it solved it already.
Just an annotation: Though I said it’s a valid way to connect page and form, I think it might be wise to check whether this way you obstruct the possibility to switch between forms from the Write panel, I mean the “overwrite form” feature.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: One Page, different content using forms
From what I see it does, but I have resolved that by having a seperate page for content. So I only have 2 pages set up which is easy to manage, unlike before where I had 50+!
Offline