Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

putting images within divs


Go to End


13 Posts   3688 Views

Avatar
dhensby

Community Member, 253 Posts

6 January 2010 at 2:14pm

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.

Avatar
Stefdv

Community Member, 110 Posts

7 January 2010 at 5:03am

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.

Avatar
martimiz

Forum Moderator, 1391 Posts

7 January 2010 at 8:13am

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.

Avatar
Stefdv

Community Member, 110 Posts

7 January 2010 at 8:23am

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"

Avatar
Stefdv

Community Member, 110 Posts

19 January 2010 at 10:23pm

Edited: 19/01/2010 11:09pm

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?

Go to Top