Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Displaying Article Comments in a different Div - Trouble, Please Help
Hi there, i hope im posting in the right place.
im having some trouble with my code,
what i want to achieve is this,
<body>
<container div>
<left div>
latest 5 articles in blog section with title, exerpt and author
<end left div>
<right div>
info text, search box, and archive list of blog section
<end right div>
<end container div>
<end body>
and then it to change to this when you click into the full articles via the title link
<body>
<container div>
<left div>
individual article, with comment form below it
<end left div>
<right div>
next and previous article links, and comments displayed in this column
<end right div>
<end container div>
<end body>
now so far ive got it all working, except for one bit -
– the info text, search box and archive list are displayed multiple times depending on how many articles i have listed,
so if i have 2 article extracts it shows twice, … so on.
and i cant figure out for the life of me which if statement to use to get it to show correctly.
i have tried everything i can think of, searched for examples, checked here and the wikki, gone through the book, and trundled through pages of google results.
i really need some help with this now.
you can see it in action at www.mingoinspired.com/blog
and here is the code im useing
/// page code ///
<div id=“main”>
<div id=“blog”>
<txp:article form=“default” limit=“5” />
</div>
<div id=“search”>
<txp:article form=“sidebar” />
</div>
</div>
——-
/// article form = default ///
<div id=“entry”>
<txp:if_individual_article>
<h3><txp:title /></h3>
<span class=“bodytype”>
<txp:body />
<address>— <txp:author /></address><br />
<txp:if_comments_preview>
<div id=“cpreview”>
<txp:comments_preview />
</div>
</txp:if_comments_preview>
<txp:if_comments_allowed>
<txp:comments_form isize=“25” msgcols=“40” msgrows=“10” />
<txp:else />
<p><txp:text item=“comments_closed” /></p>
</txp:if_comments_allowed></span>
<txp:else />
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<span class=“bodytype”>
<txp:excerpt />
<address>— <txp:author /></address>
<txp:comments_count /> Comments</span>
<div id=“line”></div>
</txp:if_individual_article>
</div>
———-
/// article form = sidebar ///
<txp:if_article_list>
<span class=“bodytype”>
this will be changed, but for now this is the personal blog/journal of matthew alderson
</span>
<txp:search_input label=“Search the Archives” button=“Search” size=“25” />
<br /><span class=“titletype”>
<txp:article_custom limit=“99999” form=“monthly_article” section=“blog” />
</span>
<txp:else />
<txp:link_to_prev>Previous Article</txp:link_to_prev>
<txp:link_to_next>Next Article</txp:link_to_next>
<br /><br />
<h3>Comments</h3><br />
<txp:comments limit=“99” sort=“posted desc” />
</txp:if_article_list>
any and all help with this would be great, thanks in advance
Last edited by mingo (2009-08-01 19:44:18)
Human by nature, Programmer by choice
Offline
Re: Displaying Article Comments in a different Div - Trouble, Please Help
Try this:
Change the “sidebar” form to type misc
.
Call it with <txp:output_form form="sidebar" />
instead of the article
tag you are using.
You might also want to put your site into debugging mode while you are working out issues like this — makes it easier for others to help you, too.
Code is topiary
Offline
Re: Displaying Article Comments in a different Div - Trouble, Please Help
OMG
thankyou soo much
that worked
such a simple fix for something ive been screaming at for days.
thanks again.
and ill keep my website in debugging mode for the next few days while i finnish of the rest of it.
thanks one more time
Human by nature, Programmer by choice
Offline