order of database join table links

Mikmac

New Member
Hi, I have a list of 'tables with database join elements linking to this table', in fabrik 1.0.6.
See attached picture.

Question: can I change the order in which the links are shown in the table (which is the same order as shown under this data tab).

Thanks
 

Attachments

  • tablelinks.png
    tablelinks.png
    92.7 KB · Views: 289
hi - not easily I'm afraid
You would need to make a custom table template and manually order your rows
 
All right,
1. I am quite happy to do that with the template. Can you help me on the way with an example or is it not that easy? How can I call these items in the template? I can't work out how they get to be shown in the first place and whether I could manually position them by calling their id or so. I will paste code below of the template that I was using.


Code:
<?php 

/**
 * @package  fabrik
 * @version 905 | fabrik_cheesegrits | 2008-05-19 21:21:05 +0200 (Mon, 19 May 2008
 * @Copyright (C) Rob Clayburn
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 */

/* 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;?>"><?php echo _ADD_RECORD;?></a> 
		</span> 
	<?php }?> 
	<?php if($this->showCSV){?> 
		<span class="pagenav"> 
			<a href="<?php echo $this->csvLink;?>"><?php echo _EXPORT_TO_CSV;?></a>
		</span>
	<?php }?> 
	<?php if($this->showRSS){?> 
		<span class="pagenav"> 
			<a href="<?php echo $this->rsslink;?>"><?php echo _SUBSCRIBE_RSS;?></a>
		</span>
	<?php }?>
	<?php if($this->showFilters){?>
		<table class="filtertable">
		<tr>
			<th style="text-align:left"><?php echo _SEARCH;?>:</th>
			<th style="text-align:right"><a href="#" class="clearFilters"><?php echo _CLEAR ?></a></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="<?php echo _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 $gkey => $group){?>
		<table class="fabrikTable">
			<tr>
			<?php foreach($this->headings as $heading){?>
				<th><?php echo $heading;?></th>
				<?php }?>
			</tr>
			<?php
			$c = 0;
			foreach($group as $rkey => $row){ ?>
				<tr class="oddrow<?php echo $c;?> <?php echo implode(' ',$this->rowClasses[$gkey][$rkey]); ?> ">
				<?php
				foreach($this->headings as $heading=>$label){ ?>
					<td class="<?php echo $this->cellClasses[$gkey][$rkey][$heading];?>"><?php  echo($row->$heading);?></td>
				<?php }?>
				</tr>
				<?php $c = 1-$c;;
			}
		}?>
		<tr class="fabrik_calculations">
		<?php
		foreach($this->calculations as $cal){
			echo "<td>" . $cal->calc ."</td>";
		}
		?>
		</tr>
		</table>
		<?php echo $this->nav;
		if( $this->canDelete ){?>
		<label><input type="checkbox" id="table_<?php echo $this->table->id;?>_checkAll" /><?php echo _CHECK_ALL;?></label>
		<?php
		}
		echo $this->deleteButton;
		echo "&nbsp;" . $this->emptyButton;?>
<?php }
print_r($this->hiddenFields);?>
</form>
 
you will need to replace this:

Code:
                <?php
                foreach($this->headings as $heading=>$label){ ?>
                    <td class="<?php echo $this->cellClasses[$gkey][$rkey][$heading];?>"><?php  echo($row->$heading);?></td>

            }

with the html to build each of your "<td>"'s in te correct order e.g.

PHP:
<?php $heading = 'tablename___elementname';?>
  <td class="<?php echo $this->cellClasses[$gkey][$rkey][$heading];?>"><?php  echo($row->$heading);?></td>

<?php $heading = 'tablename___elementname2';?>
  <td class="<?php echo $this->cellClasses[$gkey][$rkey][$heading];?>"><?php  echo($row->$heading);?></td>
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top