Jump to:

3444 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » Content block based interface

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

Page: 1
Go to End
Author Topic: 1436 Views
  • ianpiper
    Avatar
    Community Member
    32 Posts

    Content block based interface Link to this post

    I asked about building an interface based on content blocks a while back. The advice was useful and I am getting somewhere. However I have another question about structuring the application. I'm not sure whether it comes under templates or data models, so I am asking here.

    I have put up the beginnings of the new site here: http://skeyn.com/

    If you look at the home page here you will see a set of content blocks. Each of these is in effect the summary of a story that will appear in full on another page. I started by using Content.FirstParagraph to bring the content from the destination page into the content block, but this has a couple of drawbacks: it loses any text enhancement such as bold text, and I can't bring in images.

    What I would like to do is have a definable section of text as a teaser on the front page, and a thumbnail image. Clicking the "read more" would take me to the full story with all of the text and a full-sized image.

    The question is, should I have specific extra data fields in the full story to hold a teaser and thumbnail image, or is there a way to pick up just a section of the story to put on the front page (and ideally to put a thumbnail of the image there too)? I have looked at the tutorial where they are putting staff pictures up but can't see how to translate it to my need. I have also found a page in the documentation about the use of the HTMLText class but likewise can't quite see how to use it.

    Hope this isn't too rambling and that someone can advise.

    Thanks,

    Ian.
    --

  • ianpiper
    Avatar
    Community Member
    32 Posts

    Re: Content block based interface Link to this post

    I think I have sorted it out now, though naturally I would still welcome any advice. Basically I have added two new fields to my ContentBlockPage class, to hold a teaser image and teaser text. Then I am picking those up in the ContentBlockHolder template. Seems to work well.

    1436 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.