rob
Administrator
the table templates are found in
components/com_fabrik/views/table/tmpl/
each template has its own folder
It must contain the following files:
template.php - this does the rendering of the form into html
template.css - this provides the styling options for the form.
Its best to create a new template folder, lets call it "alberghi" and create your template files there, rather than overwriting the existing template files, as your changes will be overwritten if you update Fabrik at some later point.
transferring the template you listed below to the new format (in the file alberghi/template.php) would make it look like this:
adding in the image might be achieved by replacing
with
where the "jos_alberghi___image" would refer to the image element. Depending on how alberghi stores the image path you might have to alter the image src I've given above to get the correct path
Save your template files and upload them onto your server.
Now edit the fabrik table and select "alberghi" for the table template
Save your fabrik table
Your table should now use the new template and hopefully show the image as well.
let me know if that makes sense
Rob
components/com_fabrik/views/table/tmpl/
each template has its own folder
It must contain the following files:
template.php - this does the rendering of the form into html
template.css - this provides the styling options for the form.
Its best to create a new template folder, lets call it "alberghi" and create your template files there, rather than overwriting the existing template files, as your changes will be overwritten if you update Fabrik at some later point.
transferring the template you listed below to the new format (in the file alberghi/template.php) would make it look like this:
Code:
<?php /**
* @package fabrik
* @version 1.0.4
* @Copyright (C) Rob Clayburn
* @license GNU/GPL [url]http://www.gnu.org/copyleft/gpl.html[/url]
*/
/* MOS Intruder Alerts */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
?>
<h1><?php echo $this->table->label;?></h1>
<?php echo $this->table->intro;?>
<form action="<?php echo $this->table->action;?>" method="post" id="<?php echo $this->formid;?>" name="fabrikTable">
<?php if($this->showAdd){?>
<span class="pagenav">
<a href="<?php echo $this->addRecordLink;?>">Add Listing</a>
</span>
<?php }?>
<?php if($this->showCSV){?>
<span class="pagenav">
<a href="<?php echo $this->csvLink;?>">Export to CVS</a>
</span>
<?php }?>
<?php if($this->showRSS){?>
<span class="pagenav">
<a href="<?php echo $this->rsslink;?>">Subscribe RSS</a>
</span>
<?php }?>
<?php if($this->showFilters){?>
<table class="filtertable">
<tr>
<th colspan="2" style="text-align:left">Search:</th>
</tr>
<?php foreach($this->filters as $filter){?>
<tr>
<td><?php echo $filter->label;?></td>
<td style="text-align:right;"><?php echo $filter->element;?></td>
</tr>
<?php } ?>
<?php if($this->filter_action != 'onchange') {?>
<tr>
<td colspan="2" style="text-align:right;">
<input type="button" class="button" value="Go" name="filter" />
</td>
</tr>
<?php }?>
</table>
<?php }?> <br style="clear:both;" />
<br />
<?php if(count($this->rows) == 0){?>
<div class="emptyDataMessage"><?php echo $this->emptyDataMessage;;?></div>
<?php }else{
foreach($this->rows as $group){?>
<table class="fabrikTable">
<tr>
<tr style="background-color:#cccccc;font-weight:bold;">
<th align="left">Azienda</th>
<th align="left">Comune</th>
<th align="left">Provincia</th>
<th align="left">Scheda </th>
</tr>
<?php
$c = 0;
foreach($group as $row){
?>
<tr class="oddrow<?php echo $c % 2;?>">
<td><php echo $row->jos_alberghi___title; ?></td>
<td><php echo $row->jos_alberghi___comune; ?></td>
<td><php echo $row->os_alberghi___provincia; ?></td>
<td><a target="_blank" href="/index.php?option=com_alberghi&task=detail&Itemid=&id=<php echo $row->jos_alberghi___id; ?>">Link</a></td>
</tr>
<?php $c++;
}
}?>
</table>
<?php }
if( $this->canDelete ){?>
<label><input type="checkbox" id="table_<?php echo $this->table->id;?>_checkAll" />Check All</label>
<?php
}
print_r($this->hiddenFields);?>
<?php echo $this->nav;
echo $this->deleteButton;
?>
</form>
adding in the image might be achieved by replacing
Code:
<tr class="oddrow<?php echo $c % 2;?>">
<td><php echo $row->jos_alberghi___title; ?></td>
<td><php echo $row->jos_alberghi___comune; ?></td>
<td><php echo $row->os_alberghi___provincia; ?></td>
<td><a target="_blank" href="/index.php?option=com_alberghi&task=detail&Itemid=&id=<php echo $row->jos_alberghi___id; ?>">Link</a></td>
</tr>
with
Code:
<tr class="oddrow<?php echo $c % 2;?>">
<td><php echo $row->jos_alberghi___title; ?></td>
<td><php echo $row->jos_alberghi___comune; ?></td>
<td><php echo $row->jos_alberghi___provincia; ?></td>
<td><a target="_blank" href="/index.php?option=com_alberghi&task=detail&Itemid=&id=<php echo $row->jos_alberghi___id; ?>">Link</a></td>
<td>< img width="115" src="[url]http://www.blablabla.com/components/com_alberghi/img_thumbnails/<php[/url] echo $row->jos_alberghi___image; ?>" height="80" /></td>
</tr>
where the "jos_alberghi___image" would refer to the image element. Depending on how alberghi stores the image path you might have to alter the image src I've given above to get the correct path
Save your template files and upload them onto your server.
Now edit the fabrik table and select "alberghi" for the table template
Save your fabrik table
Your table should now use the new template and hopefully show the image as well.
let me know if that makes sense
Rob