Jump to:

22998 Posts in 11853 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Dynamic "content blocks" possible in SilverStripe?

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 2
Go to End
Author Topic: 3424 Views
  • jand
    Avatar
    Community Member
    30 Posts

    Dynamic "content blocks" possible in SilverStripe? Link to this post

    Hi,
    I wonder if it is possible to have dynamically added blocks of content in the SilverStripe edit page panel. So for example if a PageType has the fields "Title", "Short Text" and "Long Text" -> then you could click on an extra button "add block". There you may select further fields like "Video", "Slide Show", "Contact Form" or similar. Just like for example concrete5 or typo3 do it.

    I know that the structure of SilverStripe is different from these CMS but is there a module or idea on how to implement this in SilverStripe?

    thanks
    Jan

  • Juanitou
    Avatar
    Community Member
    322 Posts
  • jand
    Avatar
    Community Member
    30 Posts

    Re: Dynamic "content blocks" possible in SilverStripe? Link to this post

    Hi Juan,
    thanks for your hint … well, it's not exactly what I meant. I think these widgets are more for side bars and similar. You add a special functionality to a side bar, but can't add multiple bits of the same type (e.g. a 2 column text block) to the content area.

    If anyone knows the admin panel of concrete5 or typo3 … this is more what I mean.

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Dynamic "content blocks" possible in SilverStripe? Link to this post

    Hi,

    I don't know of "admin panel of concrete5 or typo3" but...

    I think these widgets are more for side bars and similar

    this is the impression that is given, but not true.

    can't add multiple bits of the same type (e.g. a 2 column text block) to the content area

    yes you can you just add more widget areas and change the layout of the template, if needed also change the WidgetArea template for new widget areas. It doesn't come out of the box, but it's not that hard to do almost anything with it.

    Also since you are posting in silverstirpe forum it might be best to add screen shots or give more accurate description than "admin panel of concrete5 or typo3" to get more help.

  • jand
    Avatar
    Community Member
    30 Posts

    Re: Dynamic "content blocks" possible in SilverStripe? Link to this post

    Hi,
    I had a closer look at the widgets now and I think you are absolutely right: With some amendments they could easily provide the functions I am looking for. There are only two things that are worrying me:
    - Versioning: It seems that widget content (and the whole widget list) are not considered in the page versions (at least the basic installation shows no contents for widgets in the page history)
    - Language Versions: In the basic installation my widgets were not translatable.

    PS
    Sorry for the missing screens, I attached a three step example from concrete5 now

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Dynamic "content blocks" possible in SilverStripe? Link to this post

    Language Versions: In the basic installation my widgets were not translatable.

    You'll need this...

    Object::add_extension('Widget', 'Translatable');
    Object::add_extension('WidgetArea', 'Translatable');

    Versioning: It seems that widget content (and the whole widget list) are not considered in the page versions (at least the basic installation shows no contents for widgets in the page history)

    Good point - I've noticed that, but never looked into it, I'd imagine it was like the above, but with "Versioned"...

    Object::add_extension('Widget', 'Versioned');
    Object::add_extension('WidgetArea', 'Versioned');

    Maybe you'll try the versioned thing? and please report back with your results.

    With the screen shots I've either seen someone do something like that in SS or it was screenies of the same CMS... a simple search yeilded these...

    http://www.silverstripe.org/general-questions/show/5725?start=8#post276997
    http://www.sspaste.com/paste/show/4e57c259398d4

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Dynamic "content blocks" possible in SilverStripe? Link to this post

    Hi again, I'd like to add this link that has come up on the dev list...

    https://github.com/dodat/silverstripe-page-elements

    Also I discussed this with Ingo at the London Meetup recently and Silverstripe don't even use widgets, just a HasManyCTF and put the content blocks on there.

  • jand
    Avatar
    Community Member
    30 Posts

    Re: Dynamic "content blocks" possible in SilverStripe? Link to this post

    Hi, thanks, we'll play around with the various options when the next project with this requirements comes up (for now we just "solved" it with a bunch of text fields)

    3424 Views
Page: 1 2
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.