Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-01-07 14:56:20
- mrjysta
- Member
- Registered: 2008-09-22
- Posts: 89
Can I use <txp:if_individual_article> in more then one place in a page
for example I have a H2 section of my page that uses <txp: article form =“pfile_heading” />
And another section of the page uses another article form <txp: article form =“pfile_main” />
so:
<txp:if_individual_article>
<txp: article form =“pfile_heading” />
<txp:else />
<h2>Welcome to site blah blah</h2>
</txp:if_individual_article>
plus:
<txp:if_individual_article>
<txp: article form =“pfile_main” />
<txp:else />
<h3>Subheading</h3>
<txp: article form =“home_content” />
</txp:if_individual_article>
Offline
Re: Can I use <txp:if_individual_article> in more then one place in a page
Yes, you can!
TXP Builders – finely-crafted code, design and txp
Offline
#3 2009-01-07 17:51:29
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Can I use <txp:if_individual_article> in more then one place in a page
When I’m not sure if something is possible, I just try it :) (just make sure you have a copy of your original code!)
Offline
#4 2009-01-09 17:31:52
- mrjysta
- Member
- Registered: 2008-09-22
- Posts: 89
Re: Can I use <txp:if_individual_article> in more then one place in a page
Thanks!
Offline
#5 2009-01-26 16:09:36
- mrjysta
- Member
- Registered: 2008-09-22
- Posts: 89
Re: Can I use <txp:if_individual_article> in more then one place in a page
Hi
Could someone offer a bit of advice? I tried using the <txp:if_individual_article> tag it but it only works in the first instance on my page. So my header gets the current title but everything else doesn’t show up/
Not getting any errors either so im a bit stuck :-/
Below is a reference to my page which is used in each of my 4 sections.
<txp:output_form form="bass_meta" />
<body>
<div class="wrapper">
<div class="header">
<txp:output_form form="bass_header+nav" />
</div><!-- header end -->
<div class="bar" id="<txp:section />">
<div class="inner">
<div id="headline">
<txp:if_individual_article>
<txp:article form="bass_heading" />
<txp:article form="bass_tabs" />
<txp:else />
<txp:article status="sticky" form="bass_heading" />
</txp:individual_article>
<txp:article form="bass_tabs" />
</div><!-- headline end -->
</div><!-- inner end -->
</div><!-- bar end -->
<div class="content">
<div class="content-wrapper">
<div class="sub-col">
<txp:if_individual_article>
<txp:article form="bass_simple" />
<txp:article form="bass_customFields" />
<txp:else />
<txp:article status="sticky" form="bass_simple" />
</txp:if_individual_article>
</div><!-- sub-col end -->
<txp:if_individual_article>
<txp:article form="bass_pfile_images" />
<txp:else />
<p class="call2action">contact us at : <a href="mailto:bassdancers@bassartists.co.uk">bassdancers@bassartists.co.uk</a></p>
<txp:article limit"50" form="bass_mainThumbs" />
</txp:if_individual_article>
<div class="clear"></div>
</div><!-- content-wrapper end -->
</div><!-- content end -->
<div class="push"></div>
</div> <!-- wrapper end -->
<div class="footer">
<div class="inner">
<div class="f_box1"><txp:output_form form="bass_footer_valid" /></div>
<div class="f_box"><txp:output_form form="bass_footer_contact" /></div>
<div class="f_box"><txp:output_form form="bass_footer_links" /></div>
</div> <!-- inner end -->
</div>
</body>
</html>
(edited for better code display. -Els)
Last edited by els (2009-01-26 16:32:48)
Offline
#6 2009-01-26 16:34:32
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Can I use <txp:if_individual_article> in more then one place in a page
You’re not closing the tag correctly (first instance). </txp:individual_article>
should be </txp:if_individual_article>
.
Offline
#7 2009-01-26 16:45:38
- mrjysta
- Member
- Registered: 2008-09-22
- Posts: 89
Re: Can I use <txp:if_individual_article> in more then one place in a page
Nice one Els , thank u so much !!!
Is there any way of catching errors like that without looking for a needle in a hey stack?
Offline
#8 2009-01-26 16:56:19
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Can I use <txp:if_individual_article> in more then one place in a page
mrjysta wrote:
Is there any way of catching errors like that without looking for a needle in a hey stack?
Post your code here ;)
And, when code doesn’t work as expected, you might want to take the advice in this FAQ.
Offline
#9 2009-01-26 17:31:29
- mrjysta
- Member
- Registered: 2008-09-22
- Posts: 89
Re: Can I use <txp:if_individual_article> in more then one place in a page
bookmarked/
Offline