Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-21 13:53:29

roelof
Member
Registered: 2005-03-27
Posts: 647

page problem

Hello,

I have this as a page template:

 <txp:article pgonly="1" limit="1" /><!-- om de foutmelding dat er geen article tag is te voorkomen, doet verder niets -->

<txp:if_section name="default">

 <txp:variable name="monthpage" value='<txp:page_url type="month" />' />
 <txp:variable name="pagenumber" value='<txp:page_url type="pg" />' />
 <txp:variable name="category" value='<txp:page_url type="c" /> '/>
 <txp:variable name="totpages" value='<txp:article_custom category=''<txp:category />'' month=''<txp:page_url type="month" />'' sort="Posted desc" limit="1"><txp:custom_field name="pagenr" /></txp:article_custom>' />
 <txp:variable name="firstpage" value="0" />

	<!-- check if we're on a monthly archive page or not -->
	<txp:if_variable name="monthpage" value="">

		<!-- no, this is the frontpage -->
		<txp:article_custom section="voorpagina" form="minima_photo_article_plain" />

	<txp:else />

		<txp:article_custom month='<txp:page_url type="month" />' section="articles" category='<txp:page_url type="c" />' pagenr='<txp:if_variable name="pagenumber" value="">1<txp:else /><txp:page_url type="pg" /></txp:if_variable>' limit="999" form="dagboek" sort="Posted asc" />

<!-- pagination -->

<txp:smd_if field="txpvar:totpages" operator="ge" value="11" >
    <txp:smd_if field="urlvar:pg,urlvar:pg" operator="ge,lt" value="4,8" >
     <txp:variable name="firstpage" value='<txp:variable name="pagenumber" />' />
     <txp:adi_calc name="firstpage" subtract="2" />
     <txp:variable name="lastpage" value='<txp:variable name="firstpage"/>' />
     <txp:adi_calc name="lastpage" add="10"/>   
 </txp:smd_if>
     <txp:smd_if field="urlvar:pg,urlvar:pg" operator="ge,not" value="8,0" >
     <txp:variable name="firstpage" value="7" />
      <txp:variable name="lastpage" value="17"/>
   </txp:smd_if>
       <txp:smd_if field="urlvar:pg" operator="lt" value="4" >
      <txp:variable name="firstpage" value="1" />
      <txp:variable name="lastpage" value="11"/>
</txp:smd_if>
<txp:smd_if field="urlvar:pg" operator="undefined" >
      <txp:variable name="firstpage" value="1" />
      <txp:variable name="lastpage" value="11"/>
</txp:smd_if>
</txp:smd_if>


<txp:variable name="meerdan1pagina" value='<txp:article_custom category=''<txp:variable name="category" />'' section="articles" month=''<txp:page_url type="month" />'' pagenr="2" limit="1"><txp:title /></txp:article_custom>' />

  <!-- als er tenminste één artikel op pagina 2 staat, is er meer dan 1 pagina -->
  <ul class="navlist" id="navlist"><txp:article_custom form="dagboek" month='<txp:page_url type="month" />' category='<txp:variable name="category" />' section="articles"  sort="custom_1 + 0  asc, posted asc" limit="99">
  <txp:if_variable name="meerdan1pagina" value="">
    <!-- geen artikel op pagina 2, dus is er maar 1, dus laten we paginanr. niet zien -->
  <txp:else />
    <txp:if_different>
       <li <txp:if_variable name="pagenumber" value='<txp:custom_field name="pagenr" />'> class="here" <txp:else /><txp:if_variable name="pagenumber" value=""><txp:if_custom_field name="pagenr" val="1">class="here"  </txp:if_custom_field></txp:if_variable>></txp:if_variable>
     <txp:smd_if field="txpvar:totpages" operator="ge" value="11" >
              <txp:smd_if field="pagenr" operator="ge" value="txpvar:firstpage" > 
                         <txp:smd_if field="pagenr" operator="le:NUM" value="txpvar:lastpage" > 
                        <a href="?month=<txp:page_url type="month" />&pg=<txp:custom_field name="pagenr" />"><txp:custom_field name="pagenr" /></a>&nbsp;
              </txp:smd_if> </txp:smd_if>    

      <txp:else />
            <a href="?month=<txp:page_url type="month" />&pg=<txp:custom_field name="pagenr" />"><txp:custom_field name="pagenr" /></a>&nbsp;
    </txp:smd_if>
  </txp:if_different>
     </txp:if_variable>
</txp:article_custom>
</ul>
</txp:if_variable>
</txp:if_section>


<txp:if_section="leespraat">
<txp:article_custom section="leespraat" />
</div>

On this way I see the leespraat also on the front page.
Can anyone help me figure out how I can make that the leespraat section is on one page with the lees verder link which is defined in the form default and not on the frontpage and that the custom field “pagenumber” is respected.

Roelof

Last edited by jstubbs (2011-08-21 15:14:00)

Offline

Board footer

Powered by FluxBB