Welcome to Squishdot Squishdot How-To Newbies Websites
 about
 search
 post article
 Documentation
 Mailing Lists
 Bug Tracking
 Development
 Installation
 Upgrading
 Download
 admin
 rdf

 main


Removing the "Read More" link when articles have no 'main body'
Squishdot Posted by Adman on Monday July 14, 06:43AM, 2003
from the dept.
I'd like to put an "if" statement around the code which generates the "Read More" links, so that these links are only displayed when there is data in the main body (sometimes I have a short piece of news which only needs a summary).

I have tried various 'dtml-if' statements and python variants without success. If anyone has a working solution could they post the code?

<  |  >

 

Related Links
  • Articles on Squishdot
  • Also by Adman
  • Contact author
  • The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Re: Removing the "Read More" link when articles ha
    by Chris Withers on Tuesday July 15, 01:03PM, 2003
    What happens if you try:

    <dtml-let body "showBody().strip()">
    <dtml-if body>read more...</dtml-if>
    </dtml-let>
    [ Reply to this ]
    This is what I did...
    by Manuel Aristarán on Wednesday July 16, 04:08PM, 2003
    <dtml-if body_len>
    <a href="...">...</a>
    </dtml-if>
    [ Reply to this ]
    Re: Removing the "Read More" link when articles ha
    by quux on Monday July 21, 10:17AM, 2003
    <dtml-var showSummary><BR>
    <!------- this if -->
    <dtml-if body_len>
    <A href="<dtml-var URL1 ><dtml-var thread_path>/<dtml-var id>/index_html"><B>Read More...</B></A><BR>
    <dtml-if "reply_cnt > 1"><B> (<dtml-var reply_cnt> comments<dtml-if body_len>, <dtml-var body_len> in body</dtml-if>)</B>
    <dtml-elif reply_cnt> <B>(<dtml-var reply_cnt> comment<dtml-if body_len>, <dtml-var body_len> in body</dtml-if>)</B>
    <dtml-else> <dtml-if body_len><B>( <dtml-var body_len> in body)</B></dtml-if>
    </dtml-if>

    -----------------------

    Works for me (just started fiddling, see http://freezope2.nipltd.net/quux/SQ42)

    CC.
    [ Reply to this ]
    Remember about attachments though...
    by Chris Beaven on Thursday August 28, 04:21AM, 2003
    You should also show the read more if the message has an attachment
    [ Reply to this ]
    The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Powered by Zope  Squishdot Powered
      "Any system that depends on reliability is unreliable." -- Nogg's Postulate
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©1999 Butch Landingin, ©2000-2002 Chris Withers.