
[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
RE: [ic] using Usertag table-organize example displays nothing
Thanks for your response, Jonathan! (kinda long) I'm going bald here...
Quoting Jonathan Clark:
> Firstly, what do you see in the page? If you see [table-organize] on the
> page, interchange is not treating it as a valid usertag.
This basic code:
[include templates/regions/top]
[include templates/regions/left]
[search-region]
<!-- this is where the table should be -->
<table>
[search-list]
[table-organize
interpolate=1
cols=3
pretty=1
tr.0='bgcolor="#EEEEEE"'
tr.1='bgcolor="#FFFFFF"'
td.0='align=right'
td.1='align=center'
td.2='align=left'
]
[loop list="1 2 3 1a 2a 3a 1b"] <td> [loop-code] </td> [/loop]
[/table-organize]
[/search-list]
</table>
[/search-region]
[include templates/regions/bottom]
Produces this (no ouput to page):
<html>
<head>
<title>The Interchange Test Catalog</title>
</head>
<body>
<div align=center>
<table width="80%" border cellpadding=15>
<tr><td colspan=2 align=center><h1>The Interchange Test
Catalog</h1></td></tr>
<tr>
<td align=center>(left)</td>
<td align=center>
<!-- this is where the table should be -->
<table>
</table>
</td>
</tr>
<tr><td colspan=2 align=center>(bottom)</td></tr>
</table>
</div>
</body>
</html>
This is basicly the example in the documentation, shown below. It does not
show the [table-organize] code or even <table> code, just blank space where
the table should be. It seems to parse the code, but outputs nothing. The
rest of the page output is fine.
> If you have a valid usertag file in the correct location, and restart ic,
> you don't need a reference in the interchange.cfg as well.
OK, I removed all table_organize references in interchange.cfg and I put the
usertag table_organize in /usr/lib/interchange/usertag, and restarted IC.
> Lets make sure ic is has the usertag compiled in before continuing... then
> pls provide the complete code for the use of the tag
Usage is below, I also attached the full tag routine:
UserTag table-organize Documentation <<EOD
=head2 table-organize
usage: [table-organize <options>]
[loop ....] <td> [loop-tags] </td> [/loop]
[/table-organize]
Takes an unorganized set of table cells and organizes them into
rows based on the number of columns; it will also break them into
separate tables.
If the number of cells are not on an even modulus of the number of columns,
then "filler" cells are pushed on.
Parameters:
=over 4
=item cols (or columns)
Number of columns. This argument defaults to 2 if not present.
=item rows
Optional number of rows. Implies "table" parameter.
=item table
If present, will cause a surrounding <TABLE > </TABLE> pair with the
attributes
specified in this option.
=item caption
Table <CAPTION> container text, if any. Can be an array.
=item td
Attributes for table cells. Can be an array.
=item tr
Attributes for table rows. Can be an array.
=item pretty
Adds newline and tab characters to provide some reasonable indenting.
=item filler
Contents to place in empty cells put on as filler. Defaults to C< >.
=item limit
Maximum number of cells to use. Truncates extra cells silently.
=back
The C<tr>, C<td>, and C<caption> attributes can be specified with indexes;
if they are, then they will alternate according to the modulus.
The C<td> option array size should probably always equal the number of
columns;
if it is bigger, then trailing elements are ignored. If it is smaller, no
attribute
is used.
For example, to produce a table that 1) alternates rows with background
colors C<#EEEEEE> and C<#FFFFFF>, and 2) aligns the columns RIGHT CENTER
LEFT, do:
[table-organize
cols=3
pretty=1
tr.0='bgcolor="#EEEEEE"'
tr.1='bgcolor="#FFFFFF"'
td.0='align=right'
td.1='align=center'
td.2='align=left'
]
[loop list="1 2 3 1a 2a 3a 1b"] <td> [loop-code] </td> [/loop]
[/table-organize]
which will produce:
<tr bgcolor="#EEEEEE">
<td align=right>1</td>
<td align=center>2</td>
<td align=left>3</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align=right>1a</td>
<td align=center>2a</td>
<td align=left>3a</td>
</tr>
<tr bgcolor="#EEEEEE">
<td align=right>1b</td>
<td align=center> </td>
<td align=left> </td>
</tr>
See the source for more ideas on how to extend this tag.
EOD
table_organize