Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Structured Content with TableField

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 884 Views
  • mkdigital
    Avatar
    Community Member
    3 Posts

    Structured Content with TableField Link to this post

    hi!

    i'm currently working on a project where most pages have the same structure: a title and some sections. each section has html content, a category and an image.

    i dont want to edit the content of these pages with HtmlEditorField, because if an user doesnt stick to the rules the generated html markup by HtmlEditorField wont work with my css.

    i decidet to map a section to a dataObject like this:

    class Section extends DataObject {
       public static $has_one = array(
          'ColPage' => 'ColPage',
          'Image' => 'Image'
       );
    static $db = array(
    "Content" => "Text",
    "Category" => "Enum('Teaser, Normal')"
    );
    }

    and use DataObjectManager for editing in the cms, which works fine, except that it is quiet annoying that every time i want to edit a section a lightbox pops up, and i cant add an image until i saved the Section, closed it and opened it again.

    i tried to do this with TableField (which doesnt have popups but inline editing), but i couldnt get it to work with images (i read somewhere it doesnt work with htmlEditorFields nor ImageFields).

    so.. what should i do? stick with the annoying popup of DataObjectManager or use HtmlEditorField which may produce weird markup.

    maybe there is a better approach for working with heavily structured pages like that?

    thanks in advance

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Structured Content with TableField Link to this post

    Can't you just create a extendend pageclass and add more fields to that pagetype?

  • mkdigital
    Avatar
    Community Member
    3 Posts

    Re: Structured Content with TableField Link to this post

    no, because i dont want the number of fields to be predefined.

    another possible solution i thought of would be to customize htmlEditor (TinyMCE) in a way so it keeps the structure, but i dont know yet how to do this per Page.

  • mkdigital
    Avatar
    Community Member
    3 Posts

    Re: Structured Content with TableField Link to this post

    noone got an idea?

    it don't think it is uncommon to structure your content?

    help pls!

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