Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-01 15:45:16

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Article display problem

Hi,

I hope somebody can see what I can’t! I have a page which displays both the full article (#main_content) and article list (#sidebar), I’ve managed the layout but I can only get the most recent full article to display despite clicking on other articles in the list. The URL is showing that the clicked article is selected but only the most recent displays. My code is as follows:

<pre>
<code>
<!--//////////////////// main_content ////////////////////-->

<txp:if_individual_article>

<div class="grid_11">
<div id="main_content">
<txp:article_custom allowoverride="0" form="gbd_article" limit="1" pgonly="0" section="garden-notebook" status="4" />
</div><!--ends #main_content-->
</div><!--ends grid_11-->

<div class="grid_5">
<div id="sidebar">
<txp:article_custom allowoverride="0" form="gbd_articleListing" limit="10" pgonly="0" section="garden-notebook" label="<txp:section title="1"/> articles" labeltag="h4" sort="Posted desc" status="4" />
<txp:output_form form="enquiry_button" />
</div><!--ends #sidebar-->
</div><!--ends grid_5-->

</txp:if_individual_article>

<!--//////////////////// sidebar ////////////////////-->

<txp:if_article_list>

<div class="grid_11">
<div id="main_content">
<txp:article_custom allowoverride="0" form="gbd_article" limit="1" pgonly="0" section="garden-notebook" status="4" />
</div><!--ends #main_content-->
</div><!--ends grid_11-->

<div class="grid_5">
<div id="sidebar">
<txp:article_custom allowoverride="0" form="gbd_articleListing" limit="10" pgonly="0" label="<txp:section title="1"/> articles" labeltag="h4" section="garden-notebook" sort="Posted desc" status="4" />
<txp:output_form form="enquiry_button" />
</div><!--ends #sidebar-->
</div><!--ends grid_5-->

</txp:if_article_list>
</code>
</pre>

My forms are:

Article:
<h2><txp:title /></h2>
<h6>Posted on: <txp:posted /></h6 >
<h6>Originally published in:</h6 >
<br />
<txp:body />

Article Listing:
<txp:if_first_article>
<ul class="">
</txp:if_first_article>
<li class="listing">
<txp:permlink><txp:title /></txp:permlink><br />
<txp:posted format="%B %d, %Y" /></li>

<txp:if_last_article></ul></txp:if_last_article>

I’ve been staring at the code trying to workout where I’m going wrong, there may also be a cleaner way to render my code. Can anyone help? Thanks.

Last edited by decoderltd (2009-04-01 16:04:41)

Offline

#2 2009-04-01 15:49:22

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: Article display problem

hi

to display an individual article you need txp:article instead of txp:article_custom

 <txp:if_individual_article>
<div class="grid_11">
<div id="main_content">
<txp:article allowoverride="0" form="gbd_article" />
</div><!--ends #main_content-->
</div><!--ends grid_11-->

Offline

#3 2009-04-01 15:56:36

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: Article display problem

Ah, I see what I’ve done. Thank you very much Dragondz, really appreciate your help.

Offline

Board footer

Powered by FluxBB