Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Text limiting

    I have a dynamic field that tells the news that Coldfusion outputs on a
    hompage. How can I limit the number of characters that news.News shows on
    the page and just have it hyperlink to a full story.

    <table width="100%">
    <tr>
    <td height="21"><div align="left">#news.Title# -<span
    class="style1">#news.Date#</span></div></td>
    </tr>
    <tr>
    <td height="17"><div align="left">
    <p><a href="fullstory.cfm?id=#news.ID#">#news.News#</a></p>
    </div></td>
    </tr>
    <tr>
    <td height="17">&nbsp;</td>
    </tr>
    </table>

    Thanks


    Wally Kolcz Guest

  2. Similar Questions and Discussions

    1. Limiting available CSS styles
      We're testing Contribute as a possible solution for editing non-database-managed content for a ASP.NET 2.0 site that uses .NET Master Pages. We'd...
    2. Limiting connections to FMS
      I was wondering if there is a notion of (to use a Java metaphor) "static" shared objects. That is objects/streams shared across FMS instances. ...
    3. Limiting Choises
      I would like to develop a Web User Control where the user can type som text eg. e-mail, number or plain text. I would like a public property...
    4. limiting my query
      i'm building a site that takes details of stories coming in. however, i've found that the page also includes stories of dates gone by. is there...
    5. Limiting Old Posts
      From OE, when I am viewing the newsgroups with the "Show Replies to My Messages" option checked, there are old messages from a long time ago. How...
  3. #2

    Default Re: Text limiting

    You can use the left function

    Left(string, numberofcharacters)

    Ken
    The ScareCrow Guest

  4. #3

    Default Re: Text limiting

    <CFOUTPUT query="yourQuery">

    <table width="100%" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td>

    #yourQuery.Product#<br>
    <cfif len(Description) gt 50>
    #Left(Description, 50)#...(<a
    href="fullDesc.cfm?more=#yourQuery.ID#">more</a>)
    <cfelse>
    #yourQuery.Description#
    </cfif>

    </td>

    </tr>

    </table>

    </cfoutput>

    --
    ==============================
    Rez Multi-Media Productions
    [url]http://www.rez-productions.com[/url]
    Wally Kolcz <wkolcz@comcast.net> wrote in message
    news:d2csl9$l0k$1@forums.macromedia.com...
    > I have a dynamic field that tells the news that Coldfusion outputs on a
    > hompage. How can I limit the number of characters that news.News shows on
    > the page and just have it hyperlink to a full story.
    >
    > <table width="100%">
    > <tr>
    > <td height="21"><div align="left">#news.Title# -<span
    > class="style1">#news.Date#</span></div></td>
    > </tr>
    > <tr>
    > <td height="17"><div align="left">
    > <p><a href="fullstory.cfm?id=#news.ID#">#news.News#</a></p>
    > </div></td>
    > </tr>
    > <tr>
    > <td height="17">&nbsp;</td>
    > </tr>
    > </table>
    >
    > Thanks
    >
    >

    CyberShaman Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139