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.

All other Modules /

Discuss all other Modules here.

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

Preview: Event Calendar Module


Go to End


293 Posts   69242 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 April 2009 at 8:43am

It is confusing.. I tried to make that very clear in the tutorial.

"Remember, the Events control returns CalendarDateTime objects, so we need to refer to the $Event accessor to get to those fields."

So what you're saying is that when you saw this:

<div class="workshop-image">
<% control Event.Image %>
<% control CroppedImage(100,100) %>
<img src="$URL" alt="" />
<% end_control %>
<% end_control %>
</div>
<dl>
<dt>Category: </dt>
<dd>$Event.Category</dd>
<dt>Sponsor: </dt>
<dd>$Event.Sponsor</dd>
</dl>

It wasn't apparent to you that you were still in the <% control Events %> ?

Avatar
Xeal

Community Member, 37 Posts

9 April 2009 at 8:46am

UncleCheese I'm assuming this is where people get confused.

Now, somewhere below the content, we need to add some of the custom Workshop fields we created. Remember, the Events control returns CalendarDateTime objects, so we need to refer to the $Event accessor to get to those fields.

This is not entirely true because directly under $content we're not in the Events control yet. You have to go a little further to get into the Events, which is probably where people get confused.

Avatar
Victor

Community Member, 128 Posts

9 April 2009 at 8:48am

UC, you wrote "After $Content" but there are two instances of $Content, I used the first one, but only the second is in <% control Events %>

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 April 2009 at 8:50am

Thanks for clearing that up, guys. I definitely see the issue. It's funny that documentation needs beta testers the same way the actual software itself does. :)

Avatar
Xeal

Community Member, 37 Posts

9 April 2009 at 8:54am

Edited: 09/04/2009 9:07am

haha.. Yeah it is strange how there's a need for people to test all aspects of a program or in this case module, but either way it's good to have people, who can find different errors. Makes it a lot faster to debug that way =)

Avatar
Victor

Community Member, 128 Posts

9 April 2009 at 9:53am

I continued with tutorial. Created WorkshopDateTime.php and edited it and Workshop.php
However table has field and title Location, but PopUp does not. Probably one more php file needs to edited?

Victor

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 April 2009 at 12:11pm

Did you follow the instructions on using the addPopupFields() method?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 April 2009 at 12:15pm

Victor,

I've attached the three files created in the tutorial to help you out.

Attached Files
Go to Top