Jump to:

10929 Posts in 2613 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Adding an Image to the Event Calendar

Discuss all other Modules here.

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

Page: 1 2 3
Go to End
Author Topic: 3823 Views
  • OutrunTheWolf
    Avatar
    Community Member
    34 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    Just humor me and try this:

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

  • OutrunTheWolf
    Avatar
    Community Member
    34 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    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!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    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.

  • OutrunTheWolf
    Avatar
    Community Member
    34 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    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.

  • OutrunTheWolf
    Avatar
    Community Member
    34 Posts

    Re: Adding an Image to the Event Calendar Link to this post

    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?

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