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 CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)Target Event View details to an iframe
Pages: [1]   Go Down
Print
Author Topic: Target Event View details to an iframe  (Read 1969 times)
0 Members and 1 Guest are viewing this topic.
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« on: October 12, 2007, 12:27:58 PM »

I am developing a Web site that has an iframe to receive linked info.   I would like to be able to have the links to the event view details targeted to this iframe.   (See www.  foothill.  edu/intl_new/template.  php for reference.  )

(btw, I haven't yet optimized this page for IE, which always screws up layouts.  So this is best viewed on Firefox. )

I have isolated what I think are the key areas to customize in the template default.  html as follows:

+++++++++++++++
!-- EVENT VIEW — THIS IS THE DETAIL WINDOW THAT OPENS WHEN YOU CLICK ON EVENT LINK -->

<%-- EVENT VIEW --%>
<% } elsif ($VIEW eq "Event") { %>
<TABLE border="0" CELLPADDING="2" CELLSPACING="0">
<%
foreach (@$fields) {
next unless ($db->{'properties'}->{$_}->{'display_details'});
%>
<TR>
<TD ALIGN="right" VALIGN="top">
<SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN>
</TD>
<TD ALIGN="left" VALIGN="top">
<SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN>
</TD>
</TR>
<% } %>
</TABLE>


<!-- EVENT LINK TO DETAILS (TARGET THIS TO id="index"?) -->


<a href="javascript:NewWindow('<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>','500','500','custom','front');" STYLE="text-decoration:underline;" CLASS="text"><%= EVENT FIELD(title) %></a><div class="linespace">&nbsp;</div><hr><div class="linespace">&nbsp;</div>
<%/FOREACH%>
<%/IF%>
<%/FOREACH%>

<%unless($total_events){%>
<I><%= $_NO_EVENTS_LABEL %></I>
<% } %>
<DD>
</DL>
</SPAN>
</TD>
</TR>
</TABLE>
<% } %>

+++++++++++++++

But I am unsure of how to modify the code above so the linked event details end up in the iframe area instead of a popup window.   I have tried removing the "javascript:NewWindow" portion of the <a href= .   .   .  ></a> areas and inserting "target="the iframe_id_name" within the <a href= .   .   .  ></a> areas of the above codes, but this is only partially successful.   I get the

Title:      
Description:

information, but no actual data about the event. 

I will continue to work on this, but any help on this question would be greatly appreciated. 

Thanks,
Shelley

« Last Edit: October 12, 2007, 12:34:26 PM by Shelley » Logged
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« Reply #1 on: October 12, 2007, 02:52:17 PM »

Hi, it's me again.  I have solved part of the problem but the code that seems not to be working for me is the EVENT VIEW code in red boldface:


<TABLE border="1" CELLPADDING="2" CELLSPACING="0">
<%
foreach (@$fields) {
next unless ($db->{'properties'}->{$_}->{'display_details'});
%>
<TR>
<TD ALIGN="right" VALIGN="top">
<SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN>
</TD>

<TD ALIGN="left" VALIGN="top">Event description goes here (as soon as I can fix the script).
<SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN>
</TD>
</TR>
<% } %>
</TABLE>


Why won't the details/description of the event display? Do I need to modify another script?

Regards,
Shelley

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #2 on: October 14, 2007, 09:45:09 PM »

** Why won't the details/description of the event display? **

I don't know, does whatever event is being printed have any?

What other changes have you made to the template?

Can you provide a link to a calendar page exhibiting the problem??

Dan O.
Logged
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« Reply #3 on: October 15, 2007, 10:07:55 AM »

Hello Dan O,

My page is viewable at hxxp: www. foothill. edu/intl_new/template. php .

And yes, I did enter a one line description for each event I entered.  (Both are tests).  The Title: and Description: words appear, but the actual description info doesn't.   I hard coded the statement "This area does not display.  Event description goes here (when I can fix the script!). " so I could make sure that it was that part of the script that needed to be fixed.

I modified the script by removing the javascript:NewWindow info in the list view and event view within the Display List section of the international template default html as follows (captured with "view source".  Here is the default. html code:

++++++++++++++++++++++
<HTML>
<HEAD>
<TITLE>International Program</TITLE>
<META HTTP-EQUIV="expires" CONTENT="now">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<STYLE>
A { text-decoration:none; color:#ff0000; font-weight: bold}

A:hover { text-decoration:underline; }

. thinborder { border-color:#666666; border-style:solid; border-width:0px; }

. columnheader { color:#ff0000; }

. navigationtext { color:#ff0000; }

. navigationselectedtext { color:#000066; }

. commandtext { color:#000066; font-weight:bold; }

. selectedcommandtext { color:#000066; font-weight:bold; }

. gridtext { color:#000066; font-family:arial, verdana, helvetica, sanserif; }

. griddatetext { color:#000066; background-color:#CCCCCC; font-weight:bold; }

. footertext { color:#000000; }

. text { color:#000066; }

. messagetext { color: red; }

. linespace {font-size: 2px; line-height: 3px; z-index: 1}

hr {
border: 0;
width: 100%;
color: #f00;
background-color: #f00;
height: 1px;
}

. headertext { font-size: 12; font-weight: bold; font-variant: small-caps }

. red {color: #ff0000 }
. teal {color: #008080 }
. purple {color: #663399 }
. burnt {color: #990000 }
. blue {color: #006 }
. white {color:#ffffff }

</STYLE>


<script language="JavaScript1. 1" type="text/javascript"><!--
function last(){
tour=window. open("hxxp: www. foothill. edu/cgi-bin/calendar. pl?calendar=international&year=2007&month=10&date=8", "Last", "height=500,width=540,toolbar=yes,statusbar=no,scrollbars=yes,resizable=yes");
}
function next(){
tour=window. open("hxxp: www. foothill. edu/cgi-bin/calendar. pl?calendar=international&year=2007&month=10&date=22", "Next", "height=500,width=540,toolbar=yes,statusbar=no,scrollbars=yes,resizable=yes");
}

function what(){
tour=window. open("", "What", "height=500,width=540,toolbar=yes,statusbar=no,scrollbars=yes,resizable=yes");
}


function dayview(){
tour=window. open("", "Dayview", "height=500,width=540,toolbar=yes,statusbar=no,scrollbars=yes,resizable=yes");
}
// -->
</script>

<SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>
<!--
/****************************************************
AUTHOR: WWW. CGISCRIPT. NET, LLC
URL: hxxp: www. cgiscript. net
Use the code for FREE but leave this message intact.
Download your FREE CGI/Perl Scripts today!
( hxxp: www. cgiscript. net/scripts. htm )
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen. width)?Math. floor(Math. random()*(screen. width-w)):100;mytop=(screen. height)?Math. floor(Math. random()*((screen. height-h)-75)):100;}
if(pos=="center"){myleft=(screen. width)?(screen. width-w)/2:100;mytop=(screen. height)?(screen. height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=yes,directories=no,status=yes,menubar=yes,toolbar=no,resizable=yes";win=window. open(mypage,myname,settings);
win. focus();}
// -->
</script>

</HEAD>

<BODY BGCOLOR="#ffffff" LINK="#FF0000" ALINK="#ff0000" VLINK="#CCCCCC" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<!-- OVERALL TABLE -->

<TABLE border="0" CELLPADDING="0" CELLSPACING="0">

<!-- FIRST ROW, HEADER -->   

<!-- SECOND ROW, MONTH VIEW -->
<TR>
<TD COLSPAN="2" HEIGHT="25">

<div align="center"   <TABLE border="0" CLASS="thinborder" CELLPADDING="0" CELLSPACING="0" >
<TR>

<!-- PREVIOUS AND NEXT WEEK LINKS -->

<TD ALIGN="left" BGCOLOR="#ffffff">
<B><A HREF="javascript://" onclick="last()" onmouseover="window. status='Last'; return true;" onmouseout="window. status=''; return true;" class="navigationtext">&lt;</A></B>&nbsp; </TD>

<TD ALIGN="center" BGCOLOR="#ffffff"><B><SPAN CLASS="navigationtext"><FONT SIZE=+0 COLOR="#ff0000">10/15/2007 &#150;  10/21/2007</FONT></SPAN></B></TD>

<TD ALIGN="right" BGCOLOR="#ffffff">
<B><A HREF="javascript://" onclick="next()" onmouseover="window. status='Next'; return true;" onmouseout="window. status=''; return true;" class="navigationtext"> &nbsp; &gt;</A></B></TD>
</TR>
</TABLE></div>

</TD>
</TR>

<TR>
<TD WIDTH="100" align="left" valign="top">
</TD>


<TD VALIGN="top" ALIGN="left" WIDTH="100%">

<hr>
<TABLE border="0" cellspacing="0" cellpadding="0">
<TR>
<TD ALIGN="left" valign="top">

<SPAN CLASS="text">
<DL><DT>

<a href="hxxp: www. foothill. edu/cgi-bin/calendar. pl?calendar=international&selected_datestring=20071016&datestring=20071016&view='Day','acepopup','500','500','custom','front';" STYLE="text-decoration:none;" CLASS="text" target="index"><B CLASS="burnt">Tuesday, October 16</B></A><br>

12:00 pm
-4:00 pm
<br>

<!--EVENT LINK TO DETAILS TARGET THIS TO INDEX -->
<a href="hxxp: www. foothill. edu/cgi-bin/calendar. pl?calendar=international&view=Event&event_id=394','500','500','custom','front';" STYLE="text-decoration:underline;" CLASS="text" target="index">International Students Program</a><div class="linespace">&nbsp;</div><hr><div class="linespace">&nbsp;</div>

<a href="hxxp: www. foothill. edu/cgi-bin/calendar. pl?calendar=international&selected_datestring=20071018&datestring=20071018&view='Day','acepopup','500','500','custom','front';" STYLE="text-decoration:none;" CLASS="text" target="index"><B CLASS="burnt">Thursday, October 18</B></A><br>
1:00 pm
-3:00 pm

<br>
<!--EVENT LINK TO DETAILS TARGET THIS TO INDEX -->
<a href="hxxp: www. foothill. edu/cgi-bin/calendar. pl?calendar=international&view=Event&event_id=395','500','500','custom','front';" STYLE="text-decoration:underline;" CLASS="text" target="index">International Student Lunch</a><div class="linespace">&nbsp;</div><hr><div class="linespace">&nbsp;</div>
<DD>
</DL>
</SPAN>
</TD>
</TR>
</TABLE>

<!-- DAY TABLE -->      
</TD>
</TR>
<!-- <TR>
<TD ALIGN="center" COLSPAN="2" BGCOLOR="#ffffff">
<FONT SIZE="-2">
<SPAN CLASS="footertext">
<A HREF="hxxp: www. CalendarScript. com/" CLASS="footertext" STYLE="text-decoration:underline;">Calendar</A> Powered by <A HREF="hxxp: www. CalendarScript. com/" CLASS="footertext" STYLE="text-decoration:underline;">CalendarScript</A>
</SPAN>
</FONT>
</TD>
</TR> -->
</TABLE>
++++++++++++++++++++++

Hope I am explaining this clearly.  Many thanks for any help you can give me with this.

Best regards,
Shelley


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: October 15, 2007, 03:53:40 PM »

PS. Your replies do not appear to be displaying in the message thread. I can only see them when I reply to your message so I don't know how many others can even read all the problem details.

JFYI

Dan O.
« Last Edit: October 15, 2007, 04:47:43 PM by DanO » Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #5 on: October 15, 2007, 04:47:14 PM »

The problem looks to be all the rest of the 'crap' you have in your links:

<!--EVENT LINK TO DETAILS TARGET THIS TO INDEX -->

<a href="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>','500','500','custom','front';" CLASS="text" target="index">

All that extraneous stuff  is making the passed data unreadable to the script.

You can see the template itself works here:

LINK > Event Details

JFYI

Dan O.

« Last Edit: October 16, 2007, 02:24:40 PM by DanO » Logged
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« Reply #6 on: October 15, 2007, 07:14:29 PM »

Sorry.  Don't understand what you are  referring to.  You sound angry.

I guess I'll try to solve it myself.

Thanks anyway,
Shelley
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #7 on: October 15, 2007, 10:33:12 PM »

The link URL must end with the event ID number. Eg. <a href="h ttp://www... event_id=394

Everything after that until the next double quote (") shouldn't be there and is what is causing your problem.

(I assume that stuff  is left over from whatever you attempted previously. Maybe start again fresh with a clean template?)

JMO

Dan O.

Logged
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« Reply #8 on: October 16, 2007, 11:23:05 AM »

Got it.  But the code I pasted in was from a "view source" so that "stuff" was the interpretation of the browser and not the clean code from the actual default. html.  Here is what is in the template default. html code that I am using:

<DL><DT>
                     <%$total_events=0;%>
                     <%FOREACH EVENTLIST%>
                        <%IF EVENTS EXIST%>
                        <%$total_events++;%>
                        
                        <a href="<%=$CGI_URL_QUERYSTRING%>selected_datestring=<%=$DAY->{'datestring'}%>&datestring=<%=$DAY->{'datestring'}%>&view='Day','acepopup','500','500','custom','front';" STYLE="text-decoration:none;" CLASS="text" target="index"><B CLASS="burnt"><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%></B></A><br>
                        
                           <%FOREACH EVENT%>
                              <% if ($_SHOW_GRID_EVENT_BULLET) {%>&#149;<%}%>
                              <% if ($_SHOW_EVENT_TIMES eq "ALL" || $_SHOW_EVENT_TIMES eq "START") { %>
                                 <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %>
                              <% } %>
                              <% if ($_SHOW_EVENT_TIMES eq "ALL") { %>
                                 <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %>
                              <% } %>
                              <% if (($_SHOW_EVENT_TIMES eq "ALL" || $_SHOW_EVENT_TIMES eq "START") && ($EVENT->{'schedule'}->{'start_time'})) { %>  <% } %><br>

<!--EVENT LINK TO DETAILS TARGET THIS TO INDEX -->

<a href="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>','500','500','custom','front';" STYLE="text-decoration:underline;" CLASS="text" target="index"><%= EVENT FIELD(title) %></a><div class="linespace">&nbsp;</div><hr><div class="linespace">&nbsp;</div>
                           <%/FOREACH%>
                        <%/IF%>
                     <%/FOREACH%>
                  
                     <%unless($total_events){%>
                     <I><%= $_NO_EVENTS_LABEL %></I>
                     <% } %>
                     <DD>
                     </DL>

This information is displaying OK.


Then, I identified that the area below is not displaying.  I am lacking some code, obviously.  I will go back and look at my other template default code in the same are and see what I need to do.  In the meantime,  I have added a hard code statement to this effect (in red below) so that I can easily see what I need to do and where.  Haven't figured it out yet, but am working on it.

<!-- EVENT VIEW — THIS IS THE DETAIL WINDOW THAT OPENS WHEN YOU CLICK ON EVENT LINK -->
<blockquote>

      <%-- EVENT VIEW --%>
      <% } elsif ($VIEW eq "Event") { %>
      
   <center>
         <TABLE border="1" CELLPADDING="2" CELLSPACING="0">
         <%
         foreach (@$fields) {
            next unless ($db->{'properties'}->{$_}->{'display_details'});
         %>
            <TR>
               <TD ALIGN="right" VALIGN="top">
               <SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN>
               </TD>
               
               <TD ALIGN="left" VALIGN="top">This area does not display.  Event description goes here (when I can fix the script!).
               <SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN>
               </TD>
            </TR>
         <% } %>
         </TABLE>
         </center>
</blockquote>

Thanks for your patience in responding to me.  I'll be back, either with the solution or further musings.

(BTW, I don't know why my replies and your posts are not displaying for everyone else. )

Shelley
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #9 on: October 16, 2007, 12:16:31 PM »

Do you seen the red colored text in my reply?
Logged
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« Reply #10 on: October 16, 2007, 12:43:49 PM »

Yes I saw it and I have solved the problem before your last reminder! But now I realize the clue you were giving me!

Instead of:
<a href="javascript:NewWindow('<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>','acepopup','500','500','custom','front');" STYLE="text-decoration:underline;" CLASS="text"><%= EVENT FIELD(title) %></a>

it should be:

<a href="javascript:NewWindow('<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>','index','custom','front');" STYLE="text-decoration:underline;" CLASS="text"><%= EVENT FIELD(title) %></a><BR><br>

where "index" is my target iframe.


Woohoo! The 'acepopup','500','500' defines the targeted external window.  Replacing it with 'index' targets it to the iframe named and indexed as "index. "

You knew that all along! Thanks for letting me figure it out (with your patient help).  I understand this code better now.

Best,
Shelley

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #11 on: October 16, 2007, 02:23:19 PM »

It would have been best to stick with plain HTML for the links by just removing the text I highlighted and not relying on JavaScript as your links won't work in a browser with JavaScript turn off. But as long as you're happy with it the way it works now...

Dan O.
Logged
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« Reply #12 on: October 16, 2007, 06:20:18 PM »

I'll try that.

Thanks for your help.

Shelley
Logged
Shelley
New Member
*

Karma: 0
Offline Offline

Posts: 13

Web Designer


« Reply #13 on: October 17, 2007, 10:44:02 AM »

Hello DanO,

I think this my final post to this topic.

I went in and removed the javascript window code and just made everything plain html, as you suggested. It works great! Goes to the iframe. Thank you again for your help.

Best,
Shelley
Logged
Pages: [1]   Go Up
Print
Jump to: