Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » putting images within divs

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

Page: 1 2
Go to End
Author Topic: 2409 Views
  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: putting images within divs Link to this post

    Hi Sefdv,

    It sounds like really you dont want to control the people, but you want to control the Jobs (or the 'area' they work in). So you would go through the BoardMembers and then the football team, etc.

    Something like:

    <% Control Board.Members %>
    <div class="boardMember">
    <h2>$Name</h2>
    $Picture.SetWidth(100)
    </div>
    <% end_control %>


    That should work as long as your links are set up properly.

    Sorry if that misses what you are trying to get at, but that should be a starting point.

  • Stefdv
    Avatar
    Community Member
    110 Posts

    Re: putting images within divs Link to this post

    Pigeon, thanks for the quick reply.

    Your option crossed my mind, the problem is...

    I just create the CMS, i'm not gonna actualy use it. So someone with sufficient rights in the company should be able to create a new 'Job' and add exististing people from the DB, maybe they want to start a Basketball team ( The captain of the Football team is maybe just a player in the Basketball team and should be placed lower on the Basketball page). The solution you give would require that a new page type is created (BasketballPage.php) and that's not an option.

    But anyway thanks for the input.

  • martimiz
    Avatar
    Forum Moderator
    1081 Posts

    Re: putting images within divs Link to this post

    Why not do something like: Page 'has_many' OrganigramItems has_one 'BoardMember'?

    Meaning: keep your boardmembers as they are now, managed in ModelAdmin. Then create another DataObject 'OrganigramItem' that 'has_one' BoardMember.

    Now create a new pagetype 'Organigram' that 'has_many' OrganigramItems, and on this pagetype use the DataobjectManager or a ComplexTableField to manage these OrganigramItems. Make sure to add a BoardMember dropdown to the OrganigramItem popup fields to link the item to the right board member.

    Each OrganigramItem should hold the data that define its place within the organigram, to be used from within the template.

  • Stefdv
    Avatar
    Community Member
    110 Posts

    Re: putting images within divs Link to this post

    Okay,okay i see what you mean.
    I'm gonna work this out...Give me a few days.

    Thanks a lot for the "new light"

  • Stefdv
    Avatar
    Community Member
    110 Posts

    Re: putting images within divs Link to this post

    Sorry for the late reply, but i'm really strugling with this.
    I believe i'm in a kind of 'tunnel vision'.

    I keep coming up with the same problem.
    If i make Items and give them a position on the page, i'm still stucked with the issue that that Item can't have a different position on a different page.

    When i create some kind of 'standard' page with all the Items on their own position, then i''m stuck with the problem that each item can only have one person.
    Lets say;
    OrganigramPage 1, Item B5 (position in the grid) has BoardMember 11
    OrganigramPage 2, Item B5 now needs BoardMember 21...Since each Item has_one Boardmember, it implies that now Item B5 on OrganigramPage 1 also changes.

    I guess that one of my issues is one of your remarks;

    <quote> Each OrganigramItem should hold the data that define its place within the organigram, to be used from within the template.
    <unquote>

    (I could fix the whole issue by adding the same Members several times in the DataBase....But that's not really what a CMS is all about and would conflict with the DRY principle.)

    If you could help me out with my "wrong" approach...well Please?

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