Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Text Columns... Grab content and process depending on length

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1461 Views
  • fsapa
    Avatar
    Community Member
    1 Post

    Text Columns... Grab content and process depending on length Link to this post

    Hi!

    I'd like to make a theme that displays the text content in columns. However, as my theme is a horizontal layout, I need an undetermined number of columns. I have no problems making the columns themselves... it's just plain HTML + CSS.

    The real problem is to get the content, get the number of characters, divide by 800 (my char limit), round it up, then print a <td>content here</td> for each 800-char packet. The Css will take care of the rest.

    As you see, I've got a fairly good idea of what to do, and if it was just PHP I'd already have finished. But I just can't seem to find: a) a way to get the length of the content; and b) a way to make the above into something usable by the template...

    So?

  • Briohny
    Avatar
    Community Member
    199 Posts

    Re: Text Columns... Grab content and process depending on length Link to this post

    Hi fsapa,

    Did you have any luck with this? I would like to know also.

    Let me know.

    Cheers.

  • Briohny
    Avatar
    Community Member
    199 Posts

    Re: Text Columns... Grab content and process depending on length Link to this post

    I guess you probably used HTMLEditorFields?

  • Junglefish
    Avatar
    Community Member
    104 Posts

    Re: Text Columns... Grab content and process depending on length Link to this post

    Ditto.

    Is there such a thing as a length() function you can use in a ss page? Sort of like length($Content)?

    jf/

    1461 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.