[Cartoweb-users] How to create requests variables

Karol Briones karolitab at gmail.com
Tue Dec 16 20:37:56 UTC 2008


Hello Lauber, I'm trying to show values like you say, $row->cells[0] but
don't show values, I try to modify the table like this

{foreach from=$tables item=group}

{foreach from=$group->tables item=table}
{if $table->numRows > 0}

{if $table->tableTitle eq my_table_name}
{foreach from=$table->rows item=row}
  <table class="cw3table">
    <caption>{t}Tablename{/t}</caption>
       <tr>
     <th align="left">{t}First Attribute{/t}</th>
     <th align="left">{t}Second Attribute{/t}</th>
       </tr>
       <tr>
     {$ban=true}
         {foreach from=$row->cells item=value}
        {if $ban}
               <td>{$value}</td>
        {$ban=false}
        {/if}
        {if !$ban}
               <td><a href="localhost://images/{$value}"></a></td>
        {$ban=true}
        {/if}
     {/foreach}

       </tr>
  </table>
{/foreach}
{/if}

The table only have two values and it work, in the first column are values
only, and in the second column are links that go to other window, my problem
is that show both columns like links, is like the value is united with the
last one, my question is, why both columns show links, exist any way to show
this values separately? and why this $row->cells[0] don't show values.

Thanks and regards,
Karol

2008/12/15 Karol Briones <karolitab at gmail.com>

> Thanks for your help, is true but I need something like this solution
> because only need some parameters, Thanks again.
>
> Thanks and regards,
> Karol
>
> 2008/12/15 Lauber Christoph <ch.lauber at geo-thun.ch>
>
>  Hello Karol
>>
>> We solved this in our projects like this:
>>
>>
>> {foreach from=$tables item=group}
>>
>> {foreach from=$group->tables item=table}
>> {if $table->numRows > 0}
>>
>> {if $table->tableTitle eq my_table_name'}
>> {foreach from=$table->rows item=row}
>>   <table class="cw3table">
>>        <tr>
>>          <th align="left" colspan="2"><h3>{t}Tablename{/t}</h3></th>
>>        </tr>
>>        <tr>
>>          <th align="left">{t}First Attribute{/t}</th>
>>          <td align="left">{$row->cells[0]}</td>
>>        </tr>
>>        <tr>
>>          <th align="left">{t}Second Attribute{/t}</th>
>>          <td align="left"><a href="localhost://images/"|cat:$row->cells[1
>> ]>{t}my Image{/t}</a></td>
>>        </tr>
>>   </table>
>> {/foreach}
>> {/if}
>> ...
>>
>> As you see, you have to define every query by itself. Maybe not the best
>> solution. But it works.
>>
>> Regards,
>> Christoph
>>
>>
>>  -----Ursprüngliche Nachricht-----
>> *Von:* Karol Briones [mailto:karolitab at gmail.com]
>> *Gesendet:* Montag, 15. Dezember 2008 15:32
>> *An:* cartoweb-users at lists.maptools.org
>> *Betreff:* Re: [Cartoweb-users] How to create requests variables
>>
>> Hello List, I have a problem with the table plugin, I need to get a
>> specific parameter from the database for show an image, for example
>> ...
>> {foreach from=$row->cells item=value}
>>        <td><a href="localhost://images/{$value}"></a></td>
>> {/foreach}
>> ...
>>
>> but I don't know how to get a specific parameter from the array of the
>> table plugin, please help me.
>>
>> Thanks and regards,
>> Karol
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20081216/d2209028/attachment.htm 


More information about the Cartoweb-users mailing list