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


Login with username, password and session length

Search

 
Advanced search

8022 Posts in 1850 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: too much white space  (Read 759 times)
0 Members and 2 Guests are viewing this topic.
delicia
New Member
*

Karma: 0
Offline Offline

Posts: 5


WWW
« on: February 21, 2002, 02:59:00 PM »

i am using ssi only slightly customized:
http://www.berkeley-lake.ga.us/index.shtml

why is there so much space above the first date?

the table cell is set valign=top. all the dates are in the same table cell as the preceding text. the include statement immediately follows the text without even a paragraph close or br tag. i have a br tag in the foreach loop right before the month and day so that the first date won't print on the same line as the preceding text.

if you view source of the page, there are several blank lines before the first date. i can't figure out where they are coming from, but the browser is generating at least one blank line as a result.

Logged
Scott
Guest
« Reply #1 on: March 04, 2002, 09:05:00 PM »

<DL> is a block-level tag, and will always insert a line break before and after itself. Same as a <FORM> tag, for example.

------------------
Scott
CalendarScript.com


Logged
delicia
New Member
*

Karma: 0
Offline Offline

Posts: 5


WWW
« Reply #2 on: March 05, 2002, 09:00:00 AM »

but why are there so many blank lines after the dl tag and before the dt tag?

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

Logged
Scott
Guest
« Reply #3 on: March 05, 2002, 11:56:00 AM »

Ah, you mean in the source code?
I don't know. You'd need to post the source of your template file. Most likely there is a newline in the loop somewhere that is being printed for each day or something.

------------------
Scott
CalendarScript.com


Logged
delicia
New Member
*

Karma: 0
Offline Offline

Posts: 5


WWW
« Reply #4 on: June 29, 2002, 02:56:00 PM »

code:

<%
&getEvents( {'duration'=>$in{duration}} );
$DAY = $Grid->{'grid'}->
  • ->
  • ;
    $EVENTS = $DAY->{events};
    $total_events=0;
    $total_trueevents=0;
    $max_events=3;
    %>
    <%FOREACH EVENTLIST%>
       <%IF EVENTS EXIST%>
       <%$total_events++;%>
       <% $total_trueevents++;%>
       <A HREF="<%=$CGI_URL_QUERYSTRING%>selected_datestring=<%=$DAY->{'datestring'}%>&datestring=<%=$DAY->{'datestring'}%>&view=Day" CLASS="text"><%=$DAY->{monthname}%> <%=$DAY->{dd}%></a><br>
          <%FOREACH EVENT%>
             <%= EVENT FIELD(title) %><BR>
          <%/FOREACH%>
             <% if($total_trueevents >= $max_events) {
                last;
             } %>
       <%/IF%>
    <%/FOREACH%>
    <A HREF="<%=$AdminConfig->get("calendar_url")%>?calendar=<%=$calendar_key%>">View Calendar</A>

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 220

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


WWW
« Reply #5 on: June 30, 2002, 02:39:00 PM »

 
quote:
You'd need to post the source of your template file.

When posted as "code" I believe this forum software removes and blank lines that may have been there originally. delicia, try posting it as just a plain message so any spaces will (hopefully) be preserved. Maybe also include a sample of the HTML source code your browser sees.

Dan O.

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

Logged
delicia
New Member
*

Karma: 0
Offline Offline

Posts: 5


WWW
« Reply #6 on: June 30, 2002, 07:51:00 PM »

<html>

   <head>
      <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
      <meta name="generator" content="Adobe GoLive 4">
      <title>City of Berkeley Lake</title>
      <meta name="rating" content="general">
      <link href="styles/table1.css" rel="styleSheet" type="text/css">
   </head>

   <body bgcolor="white" link="#006633" alink="#cc6600" vlink="#cc6600">
      <csobj w="580" h="172" t="Component" csref="../City.data/Components/theader.html" occur="0">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
         <tr>
            <td width="148"><img height="166" width="120" src="/images/citylogo.gif" border="0" alt="City of Berkeley Lake logo"></td>
            <td>
               <div align="left">
                  <h5><a href="/index.shtml">Home</a> | <a href="/govmt.html">Government</a> | <a href="/info.html">Community</a> | <a href="http://www.berkeley-lake.com/cgi-bin/dcforum/dcboard.cgi">Forums</a> | <a href="http://www.berkeley-lake.com/dcd/">Links</a> | <a href="/sitemap.html">SiteMap</a></h5>
               </div>
            </td>
         </tr>
      </table>
      </csobj><br>
      <table border="0" cellpadding="4" cellspacing="0" width="629">
         <tr>
            <td width="124" valign="top">
               <h4>
               <table border="0" cellpadding="4" cellspacing="0" width="130">
                  <tr>
                     <th valign="top">Upcoming Events</th>
                  </tr>
                  <tr>
                     <td valign="top">Please click on link below for more details.<br>


   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   
   
   
   <A HREF="http://www.berkeley-lake.com/cgi-bin/cs3/calendar.cgi?selected_datestring=20020716&datestring=20020716&view=Day" CLASS="text">July 16</a><br>
      
         P&Z Variance Hearing<BR>
      
         
   

   

   
   
   
   <A HREF="http://www.berkeley-lake.com/cgi-bin/cs3/calendar.cgi?selected_datestring=20020718&datestring=20020718&view=Day" CLASS="text">July 18</a><br>
      
         Council Meeting<BR>
      
         
   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   

   
   
   
   <A HREF="http://www.berkeley-lake.com/cgi-bin/cs3/calendar.cgi?selected_datestring=20020810&datestring=20020810&view=Day" CLASS="text">August 10</a><br>
      
         hoa mtg.<BR>
      
         
<A HREF="http://www.berkeley-lake.com/cgi-bin/cs3/calendar.cgi?calendar=">View Calendar</A>
                     </td>
                  </tr>
                  <tr>
                     <td></td>
                  </tr>
               </table>
               </h4>
            </td>
            <td width="345" valign="top">
               <h1>City Hall</h1>
               <p>
               <table border="0" cellpadding="0" cellspacing="2" width="344">
                  <tr>
                     <td valign="top">4040 Berkeley Lake Road<br>
                        Berkeley Lake, GA 30096-3016<br>
                        770/368-9484<br>
                        770/368-8810 fax
                        <p>Hours:<br>
                        Monday 10:00 am - 1:00 pm<br>
                        Wednesday 1:00 pm - 6:00 pm<br>
                        Friday 10:00 am - 1:00 pm</td>
                     <td>
                        <div align="right">
                           <img height="183" width="140" src="images/Usflag_p.gif"></div>
                     </td>
                  </tr>
               </table>
               </p>
               <p>Approved <a href="http://www.berkeley-lake.com/cgi-bin/dcforum/kbb.cgi">council minutes, city code, and city charter</a></p>
               <p>Agenda, summary minutes, and draft minutes will be posted in Agenda <a href="http://www.berkeley-lake.com/cgi-bin/dcforum/dcboard.cgi">forum</a> when available.</p>
               <p><a href="budg2002.html">Budget</a> for 2002</td>
            <td valign="top">
               <table border="0" cellpadding="4" cellspacing="0" width="130">
                  <tr>
                     <td>
   <TABLE BORDER="0" WIDTH="100%"
  CELLPADDING="1" Cellspacing="0" bgcolor="#6699aa">
   <tr><td><TABLE BORDER="0" WIDTH="100%"
   CELLPADDING="4" Cellspacing="0">
   <tr bgcolor="#ffffff"><td>
   <font size="1" face="verdana" color="#000000"><b>Mayor's Announcements</b></font>
   </td>
   </tr>
   
   <tr bgcolor="#FFFFFF"><td>
   <font size="1" face="verdana" color="#000000"><b><a href="http://www.berkeley-lake.com/dcforum/DCForumID17/43.html">West Nile virus alert</a></b>
   <br>I got word from Tom Kitchens (BLEMA head) this AM ...<br>
      </td>
   </tr>
   
   <tr bgcolor="#ffffff"><td>
   <font size="1" face="verdana" color="#000000"><b><a href="http://www.berkeley-lake.com/dcforum/DCForumID17/42.html">Gwin. Neighborhood Leadership Institute</a></b>
   <br>The Gwinnett Neighborhood Leadership Institute is ...<br>
      </td>
   </tr>
   
   <tr bgcolor="#FFFFFF"><td>
   <font size="1" face="verdana" color="#000000"><b><a href="http://www.berkeley-lake.com/dcforum/DCForumID17/41.html">more greenspace!</a></b>
   <br>Today we closed on the purchase of "the Ferrier pr...<br>
      </td>
   </tr>
   </table></td></tr></table>

                        </td>
                  </tr>
                  <tr>
                     <td></td>
                  </tr>
               </table>
            </td>
         </tr>
      </table>
      <br>
      <csobj w="580" h="111" t="Component" csref="../City.data/Components/tfooter.html" occur="0">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
         <tr>
            <td width="138"></td>
            <td colspan="2">
               <h6><a href="/archives.html">Archives</a> | <a href="/privacy.html">Privacy Statement</a></h6>
               <p class="note">Copyright © 2000, 2001 City of Berkeley Lake.<br>
               City logo designed by Britt Taylor Collins<br>
               Web site designed by <a href="http://www.delicia.com">Delicia, Inc.</a></p>
               <p class="note">Please contact the <a href="mailto:webmaster@berkeley-lake.ga.us">webmaster</a> if you have any comments about this site.</td>
         </tr>
      </table>
      </csobj>
   </body>

</html>

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

Logged
delicia
New Member
*

Karma: 0
Offline Offline

Posts: 5


WWW
« Reply #7 on: June 30, 2002, 07:53:00 PM »

i thought my post as code was the template -- it's ssi.html -- isn't that the template? i'm not having a problem with my regular calendar, just the events listed on my home page as upcoming events.

there are many blank lines in the html for the regular calendar grid, but the page displays fine.

i took out the dl and dt tags in the ssi.html after i posted so my page looks sort of ok now. but i would still like to know why so much white space in html page when you view source. www.berkeley-lake.ga.us/index.shtml

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 220

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


WWW
« Reply #8 on: July 01, 2002, 04:33:00 PM »

     
quote:
i would still like to know why so much white space in html page when you view source

Any blank lines in the template file will show as blank lines in the final output when the page source is viewed. Since version 3.1, blank lines are not removed from the script's output.

Also, each line of template code (eg. <% if (whatever...) { %> ) will also be replaced with a blank line. To make matter worse, any blank lines and code inside a foreach loop will be repeated for each loop of that code.

For example if the template contains this:
-----------
<%FOREACH EVENTLIST%>
<div align="center"><B><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%></B></div>
_blank line_
<%IF EVENTS EXIST%>
<%$total_events++;%>
<%FOREACH EVENT%>
<UL>
----------------

The output will contain this

-----------
_blank line_
<div align="center"><B> Day Name Here, Month Name Here Day ##</B></div>
_blank line_
_blank line_
_blank line_
_blank line_
<UL>
----------------

I think you'll find that the blank lines in the output exactly equal the blank lines and code lines in the template file (multiplied in the case of foreach or other loops that may be present).

Dan O.

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


[This message has been edited by DanO (edited July 01, 2002).]

Logged
Raptor2000
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #9 on: October 27, 2003, 05:05:00 PM »

** Quote **
Also, each line of template code (eg. <% if (whatever...) { %> ) will also be replaced with a blank line. To make matter worse, any blank lines and code inside a foreach loop will be repeated for each loop of that code.

DanO, this sounds exactly like my problem.  Is there any way to keep the template code from putting in a blank line for each line of code??


Raptor2000

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 220

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


WWW
« Reply #10 on: October 27, 2003, 08:17:00 PM »

** Is there any way to keep the template code from putting in a blank line for each line of code?? **

Maybe. You'd have to look at the code in CalendarScript responsible for parsing the
templates and see where it can be optimized to remove blank lines.

Does it cause a problem? They take up next to no space (file size wise) and most
browser's shouldn't notice any difference.

Dan O.


[This message has been edited by DanO (edited October 27, 2003).]

Logged
Raptor2000
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #11 on: October 28, 2003, 02:10:00 PM »

I guess it's not really a problem.  The code works.  It's just weird when you look at the source.

Maybe I'll try to optimize it a bit, especially in the loops.

Thanks!

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

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