Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Excluding Events by Category  (Read 433 times)
0 Members and 1 Guest are viewing this topic.
ToddHayes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: December 01, 2002, 11:59:00 PM »

I've created a category selection field in the admin interface (I'm using CalendarScript 3.1). I want to exclude all entries belonging to one of the categories on the menu from appearing in a certain template.

TubaDave's filter isn't really what I need, because it should be automatic, not a user-selected omission.

Is there a line of code I can put in the template file that will keep events tagged "category_C" from appearing in the calendar?

Thanks,
Todd

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: December 02, 2002, 04:47:00 PM »

It should be possible to hard code TubaDave's mod into the template rather than allowing users to select which events to see.

But if you want to do it the hard way, find each occurance of
<%FOREACH EVENT%>
in the default.html template and add this line after it

<% next if ( $EVENT->{'details'}->{'Field_Name'} eq "category_C" ); %>

Where Field_Name is the name of the field that will contain the value "category_C".

Dan O.

PS. It may not hide them from a search's results though.


------------------

[This message has been edited by DanO (edited December 02, 2002).]

Logged
ToddHayes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: December 02, 2002, 07:04:00 PM »

Thank you, Dan. That works beautifully!

-Todd

------------------

Logged
Alvy
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: July 22, 2003, 12:30:00 AM »

How you would not display the date for the exclude events
code below. It does remove the event, but not the date for the event.

code:
<DL>
<%FOREACH EVENTLIST%>
   <%IF EVENTS EXIST%>
   <%$total_events++;%>
   <DT><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%>   <DD>
      <%FOREACH EVENT%>
            <% next if ( $EVENT->{'details'}->{'title'} eq "Pilates" ); %>


I tried inserting the <% next if ( $EVENT->{'details'}->{'title'} eq "Pilates" ); %>
after the <%FOREACH EVENTLIST%> and after <%IF EVENTS EXIST%> and after <%$total_events++;%>


Alternatively..if there was a way to NOT display recurring events in the above code, then I would use that instead.

Thanks {again}

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #4 on: July 25, 2003, 01:06:00 PM »

** if there was a way to NOT display recurring events in the above code **

I think you can make it skip the printing of recurring events by adding the following line right before or after your line:

<% next if ( $EVENT->{'details'}->{'title'} eq "Pilates" ); %>

Add this line:

<% next if ( $EVENT->{'schedule'}->{'recurrence_type'} ); %>

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: