[SOLVED] Custom templates

This post is very useful.
I have a problem with DIV List template in repeat group: when I create items records, they are duplicated, but it is the same item. Could you please help me with this issue?

Thanks a lot

upload_2019-9-13_12-30-47.png
 
May anyone could tell me what is the problem on my site page refer this list and detail template?
http://yikouzu.com/index.php/en/hotel/rent.
Photos and Tabs didn't show correctly in detail view.also layout is not right in list and detail view.
If it is caused by missing of custom CSS? Many thanks!

List View:
001.JPG

Correct list view:
correct list view.JPG

Detail Voiew:
002.JPG
Correct Detail View:
correct detail.JPG
 
May anyone could tell me what is the problem on my site page refer this list and detail template?
Well, obviously there's a whole lot wrong: HTML, CSS, the details template not being prepared for (regularlabs?) shortcuts, possibly PHP as well, etc.
Frankly, certainly too much to get it fixed here in the forum. You may want to consider hiring someone familiar with all of the above in Fabrik.
 
And please open a new thread on new issues, don't add to "solved" ones.
For regularlabs stuff: did you enable "Process Joomla plug-ins" in form Options
 
Ok. I plan to prepare a complete step by step tutorial on customizing the templates, but for now, here are the template codes used for each of the templates.

LIST VIEW

For the list view, a copy of the "div" template was used - copying the div folder with all it's files and renamed it to something else. Only the default_row.php was changed.

PHP:
<?php
/**
 * Fabrik List Template: Div Row
 * Note the div cell container is now generated in the default template
 * in FabrikHelperHTML::bootstrapGrid();
 *
 * @package     Joomla
 * @subpackage  Fabrik
 * @copyright   Copyright (C) 2005-2016  Media A-Team, Inc. - All rights reserved.
 * @license     GNU/GPL http://www.gnu.org/copyleft/gpl.html
 */

// No direct access
defined('_JEXEC') or die('Restricted access');

$rowClass = isset($this->_row->rowClass) ? $this->_row->rowClass : '';
?>
<div class="<?php echo $rowClass; ?>">
<?php foreach ($this->headings as $heading => $label) :
   $d = @$this->_row->data->$heading;

   //skip empty elements but don't skip the checkbox (delete, list plugins)
   if (isset($this->showEmpty) && $this->showEmpty === false && trim(strip_tags($d)) == '' && $heading != 'fabrik_select') :
       continue;
   endif;
   $h = $this->headingClass[$heading];
   $c = $this->cellClass[$heading];
   $hStyle = empty($h['style']) ? '' : 'style="' . $h['style'] . '"';
   $cStyle = empty($c['style']) ? '' : 'style="'. $c['style'].'"';
  $bphotosData = $this->_row->data->buwb_beaches___media_photos;
  $bdescData = $this->_row->data->buwb_beaches___media_description;
  $bnameData = $this->_row->data->buwb_beaches___beach_name;
  $btownData = $this->_row->data->buwb_beaches___beach_town;
  $bparishData = $this->_row->data->buwb_beaches___beach_parish;
  $bhoursData = $this->_row->data->buwb_beaches___beach_hours;
  $badmData = $this->_row->data->buwb_beaches___facilities_entrancefeestructure;
  $bwebsiteData = $this->_row->data->buwb_beaches___man_linkwebsite;
  $bfacebookData = $this->_row->data->buwb_beaches___man_linkfacebook;
  $btwitterData = $this->_row->data->buwb_beaches___man_linktwitter;
  $binstagramData = $this->_row->data->buwb_beaches___man_linkinstagram;
   $blikeData = $this->_row->data->buwb_beaches___media_rating_raw;
   $bActions = $this->_row->data->fabrik_actions;

  endforeach;
?>
  <div class="row-fluid fabrikDivElement beach-item">
    <div class="panel-left panel">
        <div class="beach-photos"><?php echo $bphotosData; ?></div>
        <div class="beach-actions fabrik_action">
                       <div class="btn-group">
                               <?php echo $bActions;?>
                       </div>
        </div>
    </div>
    <div class="panel-middle panel">
        <div class="beach-name"><h3><?php echo $bnameData; ?></h3></div>
        <div class="beach-location"><span><?php echo $btownData . ', ' . $bparishData; ?></span></div>
        <div class="beach-desc"><p><?php echo substr($bdescData,0,270).'...'; ?></p></div>
        <div class="beach-weblinks">
            <ul>
                               <?php if(empty($bwebsiteData)){echo '';}else{echo '<li class="beach-website"><a href="' . $bwebsiteData . '" target="_blank" rel="nofollow"><i class="fas fa-external-link-square-alt"></i></a></li>';} ?>
                               <?php if(empty($bfacebookData)){echo '';}else{echo '<li class="beach-facebook"><a href="' . $bfacebookData . '" target="_blank" rel="nofollow"><i class="fab fa-facebook-square"></i></a></li>';} ?>
                               <?php if(empty($btwitterData)){echo '';}else{echo '<li class="beach-twitter"><a href="' . $btwitterData . '" target="_blank" rel="nofollow"><i class="fab fa-twitter-square"></i></a></li>';} ?>
                               <?php if(empty($binstagramData)){echo '';}else{echo '<li class="beach-instagram"><a href="' . $binstagramData . '" target="_blank" rel="nofollow"><i class="fab fa-instagram"></i></a></li>';} ?>
            </ul>
                       <div class="beach-like">
                           <?php if($blikeData == '0.00'){echo '<i class="far fa-star"></i>';}else{echo '<i class="fas fa-star"></i>';} ?>
                           <span class="like-data"><?php echo $blikeData; ?> </span>
                       </div>
        </div>
    </div>
    <div class="panel-right panel">
        <div class="panel-inner">
            <div class="beach-adm">
                <span class="heading-adm panel-heading">Admission</span>
                <?php if(empty($badmData)) {echo '<span class="data-adm adm-hrs">Free</span>';}else{echo '<span class="data-adm adm-hrs">' . $badmData . '</span>';} ?>
            </div>
            <div class="beach-hours">
                <span class="heading-hours panel-heading">Opening Hours</span>
                <?php if(empty($bhoursData)) {echo '<span class="data-adm adm-hrs">Always open</span>';}else{echo '<span class="data-hrs adm-hrs">' . $bhoursData . '</span>';} ?>
            </div>
        </div>
    </div>
   </div>
</div>

<?php
   //echo '<pre>';
   //print_r($this->_row->data);
   //echo '</pre>';
?>

Here's the screen shot of the List page

View attachment 17673



The custom Form/Details template codes/screenshot will be in the following post.





Where can I sort this list? Which line to change?
Thanks for any help.
 
Where can I sort this list? Which line to change?
As stated above the code you quoted, it's "default_row.php", so there is nothing in there related to ordering the entire list.

You can still have the list ordered via "Order by" in the "Data" tab when editing the list: http://fabrikar.com/forums/index.php?wiki/list-edit/#data

You should also be able to order it per query string in the URL: http://fabrikar.com/forums/index.php?wiki/sorting-data/#ordering-with-the-querystring
 
As stated above the code you quoted, it's "default_row.php", so there is nothing in there related to ordering the entire list.

You can still have the list ordered via "Order by" in the "Data" tab when editing the list: http://fabrikar.com/forums/index.php?wiki/list-edit/#data

You should also be able to order it per query string in the URL: http://fabrikar.com/forums/index.php?wiki/sorting-data/#ordering-with-the-querystring

Thank for your help, but I'm still stuck on this. I'm not a coder but I can follow instructions. I've search but cannot find what I'm looking for.

1) I'm trying to make ordering of column in same style with 'Group By'. Ordering with dropdown instead of column heading.
2) I'm using a default Protostar template, with Fabrik list layout set to my custom 'div' base on custom list made by 'Winchester' here. (Thanks a lot Winchester)

1.png



Any help very much appreciated. :)
 
Last edited:
I imagine that the easiest way for you should be to add the HTML as per "Group by", and in the dropdown use URLs appended with something like
Code:
&order_by=tablename___elementname&order_dir=desc
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top