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

Adding an Image to the Event Calendar


Go to End


26 Posts   8731 Views

Avatar
OutrunTheWolf

Community Member, 34 Posts

30 June 2009 at 3:36am

Yep.

They are set as WorkshopHolder, and Workshop respectively

Here is a link to the actual page

http://www.srmpromotions.com/up-coming-events/

(Forgive the styling at the moment)

You can see, that it still looks like its using the original CalenderHolder and Calender page types.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 June 2009 at 4:32am

I just ran a flush and it seems to have changed the template. The content is now missing. Does that make sense? Where is the image supposed to be?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 June 2009 at 4:35am

Just humor me and try this:

<% control Event %>
<% control Image %>
$CroppedImage(100,100)
<% end_control %>
<% end_control %>

Avatar
OutrunTheWolf

Community Member, 34 Posts

30 June 2009 at 5:15am

Nice one Cheese. You did it again.

I can view the image on the WorkshopHolder page, and its drawing the right template for the Workshop page.

What did you do there? just simplify the code?

Thanks so much...... Again!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 June 2009 at 5:42am

Edited: 30/06/2009 5:42am

I think SSViewer has changed its parsing function in the last couple versions. You can't get away with <% control Object.Property %> or <% control Function(param,param) %> the same way you used to. Sometimes it works, sometimes it doesn't, but I always find it's safest to just drill down through multiple controls. Not pretty, but it always works.

Avatar
OutrunTheWolf

Community Member, 34 Posts

2 July 2009 at 3:28am

Edited: 03/07/2009 2:12am

Hi all, (and UncleCheese)

With regards to the Event Calendar

So the image finally worked for the Event Viewer, but I neglected to realise that the Sponsor, Category, and Registration bit didn't.


 <dl>
   <dt>Category: </dt>
   <dd>$Event.Category</dd>
   <dt>Sponsor: </dt>
   <dd>$Event.Sponsor</dd>
 </dl>
 			

EDIT 02/07/09 - http://www.srmpromotions.com/dj-factory/2009-08-08

You can see at the bottom of the page that it creates the Category and Sponsor, but doesn;t bring in the details from the CMS. I have tried lots of variations of writing this code, including inserting <% control Event %>...<% end_control %>. But as i'm dabbling, and i'm not 100% sure on how the 'control things' work.

I'd also like to use the registration field in the CMS to generate a link on the page. So where its says Tickets, i'd like to insert the Registration field there:


<div id="TicketHolder">

<a href="$Event.RegistrationLink"><h3>Event Tickets</h3></a>
 
</div>

to act as a link for that particular event.

I hope you can get what i'm trying to explain, if anyone can help with this I would greatly appreciate it.

TY the Wolf

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 July 2009 at 3:56am

I couldn't even find a <dl> on your template. You sure it isn't wrapped in some display logic? Doesn't make sense that not even the markup would show.

Avatar
OutrunTheWolf

Community Member, 34 Posts

2 July 2009 at 4:21am

Edited: 02/07/2009 4:22am

Can I try changing it to


<ul> 

<li>Category: 
<p>$Event.Category</p></li>

<li>Sponsor: 
<p>$Event.Sponsor</p></li> 

</ul> 

would this work?