Error creating Tab with Joomla 1.0.13

Status
Not open for further replies.
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:

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
 
doh, sorry it should be like this:

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>
 
Sorry Rob, still problem to locate the image.
In the previous versione I used (HTML)

Code:
<td><a target="_blank" href="/index.php?option=com_alberghi&task=detail&Itemid=&id=<mos:var name="jos_alberghi.id" />"><img width="100" src="/components/com_alberghi/img_thumbnails/<mos:var name="jos_alberghi.imgthumbname" />" height="100" /></td>

and it worked properly. I tried different test but nothing.

Can u have a look again?
Thanks
 
please post your template, and the name of the element that contains the image information
 
This is the template (your one + addon)

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">Filtra i risultati:</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="Cerca" name="filter" />
		</td>

	<?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->jos_alberghi___provincia; ?></td>
      <td><a target="_blank" href="/index.php?option=com_alberghi&task=detail&Itemid=&id=<?php echo $row->jos_alberghi___id; ?>">Dettagli</a></td>
	  <td><img width="100" src="/components/com_alberghi/img_thumbnails/<?php echo $row->jos_alberghi___imgthumbname; ?>" height="80" /></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>

the image are stored inthe server at:

/components/com_alberghi/img_thumbnails/

/components/com_alberghi/img_pictures/

and in the databade are in:

jos_alberghi_images

jos_alberghi_imgthumbname

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

Hope it will help you

Sandro
 
You were right: it was "off":

the actual path is:

Code:
<td><img width="80" src="/components/com_alberghi/img_thumbnails/<?php echo $row->jos_alberghi___imgthumbname; ?>" height="80" /></td>

Now I would like to change it littele bit.

I have 4 coloumn and I would like to have 2 coloumn total:
one with the picture and one with the other info one on top of the other.

What should be the sequence of TR and TD to create such a template?

Thank you for your effort.

Sandro
 
Thank you very muche for all your effert. At the end I changed the template because it was cousing other errors in Java pugin of other comonents. Now I'm using one that is still showing errors in the page but it is working.

Thanks againg for all.

Sandro
 
Hy Hugh and Rob,

I figure out how to create the coloumn and the row and it works since I don't have more than 3 elements to be show, then the other elements goes in the bottom of the template creating a distorsion of it and the look is not so good. I would close all the elements, created by the filtering, in a border that will close them. What I have a the moment is a border that close each single element and doesn't give, at the table, a very nice view of it.

Here I attach the code I am using, can you guys have a look on it?

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">Filtra i risultati:</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="Cerca" name="filter" />
		</td>

	<?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="filtertable" width="100%" cellpadding="5" cellspacing="0" bordercolor="#999999" style="border-width: 2px; border-color: #df1f3a">
<tbody>
		<tr>
		</tr>
	<tr style="background-color:#cccccc;font-weight:bold;">
			<td class="title" colSpan="3" align="center" class="title">   Lista delle Aziende presenti in questa sezione   </td>
		</tr>

	<?php
	$c = 0;
	foreach($group as $row){
		?>

	<tr class="oddrow<?php echo $c % 2;?>">
		
		<table class="filtertable" width="50%" cellpadding="5" cellspacing="0" bordercolor="#999999" style="width:100%;border:1px solid #000000;" valign="top">
		<tr>
			<td rowSpan="4"><a target="_blank" href="/index.php?option=com_alberghi&task=detail&Itemid=&id=<?php echo $row->jos_alberghi___id; ?>"><img width="80" src="/components/com_alberghi/img_thumbnails/<?php echo $row->jos_alberghi___imgthumbname; ?>" height="80" /></td>
			<td><strong><?php echo $row->jos_alberghi___title; ?></font></td>
		</tr>
		<tr>
			<td>[ <?php echo $row->jos_alberghi___comune; ?> - <?php echo $row->jos_alberghi___provincia; ?> ]</td>
		</tr>
		<tr>
			<td><?php echo $row->jos_alberghi___text; ?></td>
		</tr>
		<tr>
			<td><a target="_blank" href="/index.php?option=com_alberghi&task=detail&Itemid=&id=<?php echo $row->jos_alberghi___id; ?>">Dettagli</a></td>
		</tr>
</tbody>
</table>




	<?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>

Thanks in advance
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top