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
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)Drop menus for monthly navigation
Pages: [1]   Go Down
Print
Author Topic: Drop menus for monthly navigation  (Read 469 times)
0 Members and 1 Guest are viewing this topic.
lwinfrey
New Member
*

Karma: 0
Offline Offline

Posts: 0

Web Guy


WWW
« on: March 14, 2002, 10:25:00 PM »

Ok Here it is, I need a hack... The current nav menu takes up to much space for the area I have. and the client would like a drop menu in it's place.

Is this posible???


------------------
Cheers,

Loren Winfrey

Logged

Cheers,

Loren Winfrey

TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #1 on: March 15, 2002, 03:05:00 PM »

Sure it's possible, just edit the template, take out the part between
<!-- MONTH NAVIGATION -->
and
<!-- /MONTH NAVIGATION -->

Then wherever you want to display the dropdown (probably just above the command list), put this code in its place:

code:

<script language="javascript">
function changeMonths (theform)
{
 if(theform.month == 0) {
   window.location.href = "<%= LAST YEAR LINK %>";
 }
 if(theform.month == 13) {
   window.location.href = "<%= NEXT YEAR LINK %>";
 }
 window.location.href = "<%=CGI_URL_QUERYSTRING%>" + theform.month;
}
</script>

<select name="month" onchange="changeMonths(this.form)">
<option value=0><%= $LAST_YEAR %></option>
<%= &HTML::monthAbbreviationOptions($TODAY_MONTH) %>
<option value=13><%= $NEXT_YEAR %></option>
</select>


And that should give you an auto-submitting drop-down that acts just like list across the top.  Note that you can change &HTML::monthAbbreviationOptions(...) to &HTML::monthNameOptions(...) if you would like to display the whole month name instead of just the abbreviation.

David

------------------
http://www.csworkbench.com/" TARGET=_blank>http://www.uabcm.com/
http://www.csworkbench.com/

Logged

lwinfrey
New Member
*

Karma: 0
Offline Offline

Posts: 0

Web Guy


WWW
« Reply #2 on: March 25, 2002, 08:56:00 PM »

Thanks, I have anotherone for you. Is there a way to get a small calendar to display in grid format on the side of the List view?

------------------
Cheers,

Loren Winfrey

Logged

Cheers,

Loren Winfrey

TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #3 on: March 26, 2002, 02:45:00 AM »

I think you mean a small calendar with just the days numbered, and no events.  If that's right, here's the code:
code:

<TABLE border="1">
 <% FOREACH GRID ROW %>
 <TR>
   <% FOREACH GRID COLUMN %>
   <TD>
     <% if $DAY->{display} { %>
       <A HREF="<%=$CGI_URL_QUERYSTRING%>selected_datestring=<%=$DAY->{'datestring'}%>&view=Day"><%= $DAY->{'dd'} %></A>
     <% } else { %>
       ?
     <% } %>
   </TD>
   <% /FOREACH %>
 </TR>
 <% /FOREACH %>
</TABLE>

Well, that's the general idea. You probably want to do more formatting with thin borders and a background colors, but that should give you a start.  If I didn't answer your question, let me know and I'll take another stab at it.

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

[This message has been edited by TubaDave (edited March 26, 2002).]

Logged

vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: August 15, 2003, 03:12:00 PM »

In response to the message by TubaDave posted on March 15, 2002 03:05 PM.

Any idea why when I paste that code into my default.html file the calendar page comes up blank? If I paste only the following, the drop down appears but of course doesn't work.

<...>
<select name="month" onchange="changeMonths(this.form)">
<option value=0><%= $LAST_YEAR %></option>
<%= &HTML::monthAbbreviationOptions($TODAY_MONTH) %>
<option value=13><%= $NEXT_YEAR %></option>
</select>
<...>

It is when I paste the following that the calendar page appears completely blank.

<...>
<script language="javascript">
function changeMonths (theform)
{
 if(theform.month == 0) {
   window.location.href = "<%= LAST YEAR LINK %>";
 }
 if(theform.month == 13) {
   window.location.href = "<%= NEXT YEAR LINK %>";
 }
 window.location.href = "<%=CGI_URL_QUERYSTRING%>" + theform.month;
}
</script>
<...>


Thanks,
Ty

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

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