Jump to:

10986 Posts in 2724 Topics by 1817 members

All other Modules

SilverStripe Forums » All other Modules » Event_calendar --> showing $Event_Title on hover

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 1169 Views
  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Event_calendar --> showing $Event_Title on hover Link to this post

    HI, ive tried numerous ways to do so, to no success. I have two things id like to do.

    I AM USING LIVECALENDER WIDGET

    1) Id like <td> that doesnt have an event to have no <a>.

    Here is the code thats on place as we speak. Displays TEST5 (title tage) on ALL td. Normal, code below dictates this.

    <tbody>
    <% control Weeks %>
          <tr>
             <% control Days %>
                <td id="evenements" class="$Today $OutOfMonth $CurrentDay $HasEvent">
                   <a href="calendrier" title="TEST5">$Number</a>
                </td>
          <% end_control %>
          </tr>    
    <% end_control %>
    </tbody>

    Ive tried

    <tbody>
    <% control Weeks %>
          <tr>
             <% control Days %>
    <% if Events %>
                <td id="evenements" class="$Today $OutOfMonth $CurrentDay $HasEvent">
                   <a href="calendrier" title="TEST5">$Number</a>
                </td>
    <% else %>
    <td>$Number</td>
          <% end_control %>
          </tr>    
    <% end_control %>
    </tbody>

    I am getting errors from this code.

    2) Id like $_Event_Title (or any customs textfields) to show on hover

    Here is the code thats on place as we speak. Displays TEST5 (title tag) onhover. Normal, code below dictates this.

    <a href="calendrier" title="TEST5">$Number</a>

    When i try any code that starts with $ (be ity $Title, $_Title, $Date etc) , it misbehaves : some tds are disapearing.

    <a href="calendrier" title="$Event.Title">$Number</a>

    also tried

    <a href="calendrier" title="<% control Event %>$Event.Title"<% end_control %>$Number</a>

    no results either.

    Thanks for helping!

  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Re: Event_calendar --> showing $Event_Title on hover Link to this post

    Bump to the top....

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event_calendar --> showing $Event_Title on hover Link to this post

    Somewhere in the forum there's an explanation of how to do this. But here it is again:

    Around line 206 in CalendarUI.class.php, there's an array that accepts all the data for a given day in the calendar. You'll see that "HasEvent" is one field. After that entry in the array, add:
    'Events'          => $this->calendar->Events(null, $this->date_counter->date(), $this->date_counter->date()),

    And on LiveCalendarWidget.ss:

    <td class="$Today $OutOfMonth $CurrentDay $HasEvent">
    <a href="$ShowDayLink">$Number</a>
    <% if Events %><% control Events %><a href="$Event.Link">$Event.Title</a><% end_control %><% end_if %>
    </td>

    ---------------
    Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Re: Event_calendar --> showing $Event_Title on hover Link to this post

    Hi Uncle, glad to meet you. Dont go away, we are almost there.... The code you gave me works fine in the sense that it CORRECTLY displays the $Customs (see yellow tip tools in the pic) fields i want. But it messes up the calendar rendering.

    Here is the code you gave me, i just added my $Event.CustomFields:

    <td class="$Today $OutOfMonth $CurrentDay $HasEvent">
       <a href="$ShowDayLink">$Number</a>
          <% if Events %>
             <% control Events %>
                <a href="$Event.Link" title="{$Event.Title} {$Event.Conferencier}"></a>
             <% end_control %>
          <% end_if %>
    </td>

    Heres what it looks like. See below. It pushes the <% control Events %> data UNDER the number.

    I presume its a matter of reordering things. But how?

    Thanks, i made more progress on this today than in the last 3 weeks...

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event_calendar --> showing $Event_Title on hover Link to this post

    Oh, i never said anything about making it look nice. You're your own for the CSS.

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Re: Event_calendar --> showing $Event_Title on hover Link to this post

    Hi Uncle, its not about getting it nice Its about not having the background images BEHIND the dates, not UNDER them.

    Here is the reordered code:

    <td class="$Today $OutOfMonth $CurrentDay $HasEvent">
       <% if Events %>
          <% control Events %>
             <a href="$Event.Link" title="{$Event.Title} {$Event.Conferencier}">$Number</a>
          <% end_control %>
       <% else %> <!-- i want dates that has no events not to be <a href> activated -->
          <a href="$ShowDayLink">$Number</a>
       <% end_if %>
    </td>

    And here what it gives me. The date ($Number) arent showing and the events that has NO EVENTS shouldnt be a <a href> activated.

    But i do (my attempt)

    $ShowDayLink or $Number

    instead of this (your code)

    <a href="$ShowDayLink">$Number</a>

    it either shows no date at all or scrambled eggs......

    Believe me , we are a bunch who wants to do that!

    Merci beaucoup!

    Attached Files
  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Re: Event_calendar --> showing $Event_Title on hover Link to this post

    OK, we are getting close.

    Here is the code:

    <td class="$Today $OutOfMonth $CurrentDay $HasEvent">
       <% if Events %>
          <% control Events %>
             <a href="$Event.Link" title="{$Event.Title} - {$Event.Conferencier}">$Number</a>
          <% end_control %>
       <% else %>
          <a href="" title="Pas d'évènements pour cette journée">$Number</a> <!-- MEANS NO EVENTS TODAY -->
       <% end_if %>
    </td>

    It gives me this.

    PROBLEM : No numbering on dates that has events. Would like to.

    Thanks!

  • wilsonStaff
    Avatar
    Community Member
    142 Posts

    Re: Event_calendar --> showing $Event_Title on hover Link to this post

    Still struggling on this. Ive tried $Dates but it messes up other things.

    Need to access that $Number again.

    Thanks!

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