Re: phantom <table> tags

[email protected] Tue, 2 Aug 2005 22:55:32 +0200
Newsgroups gmane.comp.cms.campsite.general
Message-ID <OF12533595.FE3E2F03-ONC1257051.007257D0-C1257051.0072E914@mdlf.org>
This is a multipart message in MIME format.
--=_alternative 0072E910C1257051_=
Content-Type: text/plain; charset="us-ascii"

Actually, I'm trying to follow the manual in Section 3.5.3 "Including 
Images in the Section Listing," where it advises:

<snip>

As seen above, the sectiontemplate.tpl will always pull information out of 
the database and display it in a list format. If we have images included 
in the article, they will appear on the article page, but how can we 
display an individual, small image for one article in the section listing?
The answer is quite simple. Create a body field in your Article Type that 
will only contain the image that goes into the section listing. Let's say 
we call this variable 'sectionimage'. Then all you need to add in the 
section listing to display the image is:
<!** print article sectionimage>
This will then generate the HTML code as saved in the database. And in our 
case that means it will create the image tag including the image. You 
could even generate a little subtitle for the image in this field when 
entering the article text and images.
</snip>

What I want to do is display the article's image on the front page - not 
its text - if the 'display on front page' checkbox is ticked. So I presume 
the template language statement would include first an If statement for 
whether the article is on the front page, but how do I tell the parser the 
number of the photo, when this will be changing?

doug





Mugur Rus <[email protected]>
08/02/2005 10:47 PM
Please respond to campsite-support

 
        To:     [email protected]
        cc: 
        Subject:        Re: [campsite-support] phantom <table> tags


Don't display images from article fields, instead use template language:

<!** if image [image_nr]>
    <img src="/cgi-bin/get_img?<!** urlparameters [image_nr]>">
<!** endif>

See the manual for more details.

Mugur

--- [email protected] wrote:
> Hi all,
> 
> I've run into what may be an undocumented feature, but wanted to ask 
about 
> it anyway. 
> 
> I'm on 2.2.2 (expecting to upgrade to 2.3.0 any minute now) and want to 
> display the image from an article. The image field is called 
> 'teaser_image'.
> 
> The template looks like this:
> 
> <!** List Article OnFrontPage Is On>
> <!** Print Article teaser_image>
> <!** EndList>
> <!** endlocal>
> 
> The output, however, includes an entire table for the image:
> 
> <table border=0 cellspacing=0 cellpadding=0 align=none>
> <tr><td align="center"><img src="/cgi-bin/get_img?NrArticle=2&NrImage=1" 

> alt="RDFW bunker" BORDER=0 HSPACE=5 VSPACE=5></td></tr>
> <tr><td align="center" class="caption">RDFW bunker</td></tr>
> </table>
> 
> Seeing as I'm trying to avoid tables at all costs, I want to suppress 
all 
> this junk. But how?
> 
> doug



 
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 



--=_alternative 0072E910C1257051_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Actually, I'm trying to follow the manual in Section 3.5.3 &quot;Including Images in the Section Listing,&quot; where it advises:</font>
<br>
<br><font size=3 face="Times New Roman">&lt;snip&gt;</font>
<br>
<br><font size=3 face="Times New Roman">As seen above, the sectiontemplate.tpl will always pull information out of the database and display it in a list format. If we have images included in the article, they will appear on the article page, but how can we display an individual, small image for one article in the section listing?</font>
<p><font size=3 face="Times New Roman">The answer is quite simple. Create a body field in your Article Type that will only contain the image that goes into the section listing. Let's say we call this variable 'sectionimage'. Then all you need to add in the section listing to display the image is:</font>
<p><font size=3 face="Times New Roman">&lt;!** print article sectionimage&gt;</font>
<p><font size=3 face="Times New Roman">This will then generate the HTML code as saved in the database. And in our case that means it will create the image tag including the image. You could even generate a little subtitle for the image in this field when entering the article text and images.</font>
<p><font size=2 face="sans-serif">&lt;/snip&gt;</font>
<br>
<br><font size=2 face="sans-serif">What I want to do is display the article's image on the front page - not its text - if the 'display on front page' checkbox is ticked. So I presume the template language statement would include first an If statement for whether the article is on the front page, but how do I tell the parser the number of the photo, when this will be changing?</font>
<br>
<br><font size=2 face="sans-serif">doug</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Mugur Rus &lt;[email protected]&gt;</b></font>
<p><font size=1 face="sans-serif">08/02/2005 10:47 PM</font>
<br><font size=1 face="sans-serif">Please respond to campsite-support</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;[email protected]</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: [campsite-support] phantom &lt;table&gt; tags</font></table>
<br>
<br>
<br><font size=2 face="Courier New">Don't display images from article fields, instead use template language:<br>
<br>
&lt;!** if image [image_nr]&gt;<br>
 &nbsp; &nbsp;&lt;img src=&quot;/cgi-bin/get_img?&lt;!** urlparameters [image_nr]&gt;&quot;&gt;<br>
&lt;!** endif&gt;<br>
<br>
See the manual for more details.<br>
<br>
Mugur<br>
<br>
--- [email protected] wrote:<br>
&gt; Hi all,<br>
&gt; <br>
&gt; I've run into what may be an undocumented feature, but wanted to ask about <br>
&gt; it anyway. <br>
&gt; <br>
&gt; I'm on 2.2.2 (expecting to upgrade to 2.3.0 any minute now) and want to <br>
&gt; display the image from an article. The image field is called <br>
&gt; 'teaser_image'.<br>
&gt; <br>
&gt; The template looks like this:<br>
&gt; <br>
&gt; &lt;!** List Article OnFrontPage Is On&gt;<br>
&gt; &lt;!** Print Article teaser_image&gt;<br>
&gt; &lt;!** EndList&gt;<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; <br>
&gt; The output, however, includes an entire table for the image:<br>
&gt; <br>
&gt; &lt;table border=0 cellspacing=0 cellpadding=0 align=none&gt;<br>
&gt; &lt;tr&gt;&lt;td align=&quot;center&quot;&gt;&lt;img src=&quot;/cgi-bin/get_img?NrArticle=2&amp;NrImage=1&quot; <br>
&gt; alt=&quot;RDFW bunker&quot; BORDER=0 HSPACE=5 VSPACE=5&gt;&lt;/td&gt;&lt;/tr&gt;<br>
&gt; &lt;tr&gt;&lt;td align=&quot;center&quot; class=&quot;caption&quot;&gt;RDFW bunker&lt;/td&gt;&lt;/tr&gt;<br>
&gt; &lt;/table&gt;<br>
&gt; <br>
&gt; Seeing as I'm trying to avoid tables at all costs, I want to suppress all <br>
&gt; this junk. But how?<br>
&gt; <br>
&gt; doug<br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
____________________________________________________<br>
Start your day with Yahoo! - make it your home page <br>
http://www.yahoo.com/r/hs <br>
 <br>
</font>
<br>
<br>
--=_alternative 0072E910C1257051_=--