• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

[SOLVED] Custom templates

I tried it both ways. All 3 tempaltes (bootstrap, div & my custom div) shows the same codes output as well as the output stated in the "print_r()" output of the entire row data.

I'm not sure if this may be an issue, but I have Ajax turned of, because I didn't want the details page to open up in a popup. But, like I said, it seem to me an issue with the plugin long before my custom list template. For one, despite "show thumbs down" being set to "yes" it doesn't show the thumbs down at all on any of the rendered templates. It also doesn't seem to be recording any of the thumbs up that I've done from difference browsers. Well, it always show 1 and then if I do it again later, it may show 2. But after clearing browser cache, it goes back to 1.

In the db table, it recorded 2 entries, but does not display them on the plugin. It doesn't show any thing except for the thumbs up icon. I can't seem to figure this one out.
 
I think it's a JS issue because it uses JS to render the widget and to carryout the functions when it is clicked. So, a conflict in JS libs could cause it to not work properly. I think when it is clicked, the wrong script get triggered.

Does this sound like a plausible cause of this issue?
 
Well, do you have a JS error in the console on pageload and/or click?
Does it work with Protostar in either Fabrik template?

The template I'm running Fabrik in is a modified Protostar template, which I did because the T3 framework was giving problems. I might even change from T3 all together, but I'll worry about that later down the line.

I tired it in the original Protostar, T3 B2, T3 B3 and my customized Protostar templates, using bootstrap, div and my customized div Fabrik templates. This is what I noted,

Protostar + bootstap
  • The widget doesn't show properly (meaning it doesn't show both sides of the widget, thumbs up & thumbs down) and doesn't show the number of likes.
  • It does seem to do something when clicked (showing the number and turned green), but since the first 2 recorded clicks (I'm not sure when it was recorded), it doesn't record any further.
  • No errors or warnings show in console.

Protostar + div

  • The widget doesn't show properly (meaning it doesn't show both sides of the widget, thumbs up & thumbs down) and doesn't show the number of likes.
  • It does seem to do something when clicked (showing the number, but doesn't turn green), but since the first 2 recorded clicks (I'm not sure when it was recorded), it doesn't record any further.
  • 2 JS warning shows show in console. These codes shows on page load and not when clicked. (see below)
Code:
Use of getAttributeNode() is deprecated. Use getAttribute() instead.  mootools-core.js:108:287
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.

Protostar + Customized div
  • Everyone is just like "Protostar + div" including the 2 JS warnings. The only difference is that the page refreshes and the search/filter appendages shows in the address bar.

Code:
https://www.bigupwibeachja.org/beaches-test?resetfilters=0&clearordering=0&clearfilters=0

Customized Protostar
  • Everything is exactly the same as with each of the Protostar combinations.
JavaScripts
No extra javascipts or js libraries were added to any of the templates. However, the extensions that may have loaded extra js/js libs are the same between all the template combos. I will be going through and disable js scripts and libs shortly to see if I can find out which one is in conflict.
 
There is a problem with this line in the code.

Hi. Thanks for responding.

That line was there from the original template. In any case, the page loads fine and is working to fine now that I'm moved from the T3 framework on all pages except for the home page. I plan to remove the T3 all together soon once I'm done recreating the home page design in the ProtoStar template. I'm hoping this will resolve the issue I'm having.

I'm also trying to figure out how to make a single search field search multiple elements. I was directed to a page in the wiki that supposedly shows how to do this, but as a non-coder, nothing in the wiki is useful to me until I understand where to start. It wasn't written for designers/non-coders, as it assume anyone that reads it are coders. Also, the examples that they give are far from what majority of what users of Fabrik actually wants to do. Example: I want to use have a single search field for multiple elements, the example they would give would be a field to search some website on another planet. Not that this would be interesting, but not really useful for person coming to the wiki for help.

Anyways, any help with this would be appreciated, greatly.
 
Last edited:
I was directed to a page in the wiki that supposedly shows how to do this, but as a non-coder, nothing in the wiki is useful to me until I understand where to start. It wasn't written for designers/non-coders
I assume you are referring to this post https://fabrikar.com/forums/index.php?threads/one-search-field-multiple-elements.50501/#post-263939

1. I can't see why it should be complicated to enable "Search all" in list settings

2. Fabrik is not a "single out of the box one function" thing but a complex application builder component with more than 150 additional plugins (and everybody who is using it for FREE is invited to contribute to the WIKI where a big part does not address coding).
You can do a lot of things without any coding skills (yes, you have to read the WIKI and the tooltips in the backend), most "usual" stuff will be covered with the built-in settings.

But if you want to use all possibilities like creating custom templates, using php hooks, adding condition to plugins, expanding functionality you must know about PHP, HTML, CSS, JS, MySQL Databases - or hire a professional.
 
I didn't mean to sound as if I didn't appreciative of Fabrik, but my critique is not of "Fabrik", the extension. It is about the documentation provided for users to learn how to do things with it.

1. I can't see why it should be complicated to enable "Search all" in list settings

It is not as simple as selecting "search all" since what I need is a search in a module position on the home page, which is explained in the post.

2. Fabrik is not a "single out of the box one function" thing but a complex application builder component with more than 150 additional plugins (and everybody who is using it for FREE is invited to contribute to the WIKI where a big part does not address coding).
You can do a lot of things without any coding skills (yes, you have to read the WIKI and the tooltips in the backend), most "usual" stuff will be covered with the built-in settings.

I understand this and again, my criticism is not of "Fabrik". It is one the instructions in the wiki. Of course, not all are like that. There are some that really tried, but as become either vague in some areas or out-dated (older version of Fabrik). Again, I do appreciate both the extension and the supporting materials, tutorials and forums, but still it needed to be said, regardless. None of this does not take away from the power of the extension, but rather allowed it to improve.

Anyways, I would like to offer my time to the community to update the Wiki in making them more useful to persons like myself and for those that knows even less than me. Is it possible for me to just go into the Wiki and make changes? Is there a system in place for approvals, giving a developer a chance to look at the instructions? I would like to start with the "How to create custom List templates" and then move on to the Detail/Form templates. If the case is as simple as going to the pages and editing them, I would start putting together my page and then edits it on the wiki once I'm satisfied. I would hope that before it is published, that someone more experienced with Fabrik would be able to overlook my submissions before they are published.
 
On another note. Please understand that everyone here are here to use Fabrik in their projects. We invest out time and efforts into our projects and would like to be able to complete them. When we need help with information and can't find it, it frustrates us. The reason why forums work is because it allows us to search it to find the information we need. If none if found, then we make a post. I try to be as thorough as possible in my posts, in that I try to make sure that once I have solved the issue, I sum it up on a post so that it can be useful to other that may come after me. In fact, I was planning on posting my tutorial on creating the custom templates in the forum, if I don't have access to the wiki. While I'm here also, if I see someone else asking about something that I have already solved, I try to help them by giving then specific instructions. Of course, as I'm new to Fabrik, I there is not much I can help with as yet, but as I learn the extension I will be able to offer more.

The reason I'm saying this is that your post, the tone of it sounded like you took offense to my post before when nothing in my post was offensive by any means or measure. I mentioned nothing of the link, as I decided to talk about the usefulness of the wiki pages. Nothing I said were untrue and nothing I said were meant to offend anyone, let alone someone that have been helpful to me from the very start. However, if you did in fact, found my post to me offensive, I categorically apologize for that.
 
Hi everyone.

I finally completed the template and everything is working fine. I decided though to not bother to use the thumbs plugin and use the rating plugin instead. On the list I used "element_raw" to display just the rating score, while on the details pages, the rating element shows in full. Not very easy to style, but it worked out great.

Thank you very much, @lousyfool, @sunnyjey and @startpoint. Your help were tremendous (in a Trump voice... lol).
 
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

fabrik-tut-list.jpg



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

Attachments

  • fabrik-tut-display.jpg
    fabrik-tut-display.jpg
    172.3 KB · Views: 249
FORM & DETAIL VIEW

For the form, the bootstrap_tab was used. While nothing was done to the form files, a copy of bootstrap_tab templates renamed to the same as the list as well as the view. Similarly, the custom detail template was also copied and renamed to the same as the cusomt form's, except that it was the files from the bootstrap template and not from the bootstrap_tab. Note that this form is for a survey and has 12 groups and about 120 elements.

For the most part and more often than not, the only file that will be customized is the default.php file.

PHP:
<?php
/**
 * Bootstrap Details Template
 *
 * @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
 * @since       3.1
 */

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

$form = $this->form;
$model = $this->getModel();

/* BUWB Group Elements Variables */
$BasicInfo = $this->groups['Basic Info'];
$BasiEle = $BasicInfo->elements;
$BeachBasics = $this->groups['Beach Basics'];
$BeacEle = $BeachBasics->elements;
$Management = $this->groups['Management'];
$ManaEle = $Management->elements;
$Facilities = $this->groups['Facilities'];
$FaciEle = $Facilities->elements;
$Safety = $this->groups['Safety'];
$SafeEle = $Safety->elements;
$Activities = $this->groups['Activities'];
$ActiEle = $Activities->elements;
$Structures = $this->groups['Structures'];
$StruEle = $Structures->elements;
$Media = $this->groups['Media'];
$MediEle = $Media->elements;

$Map = $BasiEle['beach_gps']->element;
$Coords = $BasiEle['beach_gps']->element_raw;
$SurveyDate = date_create($BasiEle['survey_datetime']->element_raw);
$VegClear = $VegeEle['veg_clearing']->element_raw;
$BeachName = $BasiEle['beach_name']->element_raw;
$Website = $ManaEle['man_linkwebsite']->element_raw;
$Facebook = $ManaEle['man_linkfacebook']->element_raw;
$Twitter = $ManaEle['man_linktwitter']->element_raw;
$Instagram = $ManaEle['man_linkinstagram']->element_raw;
$Bins = $DispEle['garbage_bins']->element_raw;
$PicFile = $MediEle['media_photos']->value;

function multiexplode ($delimiters,$string) {

    $ready = str_replace($delimiters, $delimiters[0], $string);
    $launch = explode($delimiters[0], $ready);
    return  $launch;
}
$Coord = multiexplode(array('(',', ','):'),$Coords);
$lat = $Coord[1];
$lon = $Coord[2];

if ($this->params->get('show_page_heading', 1)) : ?>
   <div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
       <?php echo $this->escape($this->params->get('page_heading')); ?>
   </div>
<?php
endif;

if ($this->params->get('show-title', 1)) :?>
<div class="page-header">
   <h1><?php echo $BeachName;?></h1>
</div>
<?php
endif;

echo $form->intro;
if ($this->isMambot) :
   echo '<div class="fabrikForm fabrikDetails fabrikIsMambot" id="' . $form->formid . '">';
else :
   echo '<div class="fabrikForm fabrikDetails" id="' . $form->formid . '">';
endif;
echo $this->plugintop;
?>

<!-- BUWB Detail Template Layout -->
<div class="detail-wrap">
   <div class="detail-buttons"><?php echo $this->loadTemplate('buttons'); echo $this->loadTemplate('relateddata'); ?></div>
  {tab Overview}
  <div class="showcase-boxes">
       <div class="control-group detail-photos
               <?php if(empty($Coords) || strlen($Coords) <= 9){echo 'full';}else{echo 'share';} ?>
               <?php echo $element->containerClass; ?>" >
               <?php echo $MediEle['media_photos']->element; ?>
       </div>
    <div class="control-group detail-map <?php echo $element->containerClass; ?>" style="<?php if(empty($Coords) || strlen($Coords) <= 9){echo 'display:none; ' . strlen($Coords);}else{echo strlen($Coords);} ?>" >
           <?php if(empty($Coords) || strlen($Coords) <= 9){echo '';}else{echo $Map;} ?>
       </div>
  </div>
  <div class="details-boxes">
       <div class="detail-left">
           <div class="detail-heading-rating">
               <div class="control-group <?php echo $element->containerClass; ?> detail-heading">
                   <h2 class="detail-beachname"><?php echo $BeachName; ?></h2>
                   <div class="detail-townparish"><?php echo $BasiEle['beach_town']->element_raw; ?>, <?php echo $BasiEle['beach_parish']->element_raw; ?></div>
               </div>
               <div class="control-group <?php echo $element->containerClass; ?> detail-rating"><?php echo $MediEle['media_rating']->element; ?></div>
           </div>
           <div class="control-group <?php echo $element->containerClass; ?> detail-description"><?php echo $MediEle['media_description']->element; ?></div>
       </div>
       <div class="detail-infobar">
           <div class="info-left">
               <div class="control-group <?php echo $element->containerClass; ?> detail-adm">
                   <h4>Admission</h4>
                   <?php if(empty($FaciEle['facilities_entrancefeestructure']->element_raw)){echo 'Free';}else{echo $FaciEle['facilities_entrancefeestructure']->element;} ?>
               </div>
               <div class="control-group <?php echo $element->containerClass; ?> detail-hrs">
                   <h4>Opening Hours</h4>
                   <?php if(empty($BeacEle['beach_hours']->element_raw)){echo 'Always open';}else{echo $BeacEle['beach_hours']->element;} ?>
               </div>
               <div class="control-group <?php echo $element->containerClass; ?> detail-links">
                   <h4>Websites</h4>
                   <ul>
                       <?php if(empty($Website)){echo '';}else{echo '<li class="beach-website"><a href="' . $Website . '" target="_blank" rel="nofollow"><i class="fas fa-external-link-square-alt"></i></a></li>';} ?>
                       <?php if(empty($Facebook)){echo '';}else{echo '<li class="beach-facebook"><a href="' . $Facebook . '" target="_blank" rel="nofollow"><i class="fab fa-facebook-square"></i></a></li>';} ?>
                       <?php if(empty($Twitter)){echo '';}else{echo '<li class="beach-twitter"><a href="' . $Twitter . '" target="_blank" rel="nofollow"><i class="fab fa-twitter-square"></i></a></li>';} ?>
                       <?php if(empty($Instagram)){echo '';}else{echo '<li class="beach-instagram"><a href="' . $Instagram . '" target="_blank" rel="nofollow"><i class="fab fa-instagram"></i></a></li>';} ?>
                   </ul>
               </div>
           </div>
           <div class="control-group <?php echo $element->containerClass; ?> detail-facilities info-right">
               <h4>Features</h4>
               <div class="ratings-boxes">
                   <div class="ratings-clean"><div class="rating-bg cleanliness"><?php echo $DispEle['garbage_cleanlinessrate']->element_raw; ?></div><span>Cleanliness rating</span></div>
                   <div class="ratings-harass"><div class="rating-bg harass"><?php if(empty($ActiEle['activities_harassmentsrate']->element_raw)){echo '0';}else{echo $ActiEle['activities_harassmentsrate']->element_raw;} ?></div><span>Harassment rating</span></div>
               </div>
               <div class="feature-icons">
                   <ul>
                       <?php
                           if(isset($FaciEle['facilities_parking']->element_raw) == 'Yes'){echo '<li class="detail-icon"><i class="fas fa-parking"></i><span>Parking available</span></li>';}else{echo '';}
                           if(isset($FaciEle['facilities_pets']->element_raw) == 'Yes'){echo '<li class="detail-icon"><i class="fas fa-paw"></i><span>Pets allowed</span></li>';}else{echo '';}
                           if(isset($FaciEle['facilities_toilets']->element_raw) == 'Yes'){echo '<li class="detail-icon"><i class="fas fa-restroom"></i><span>Toilet available</span></li>';}else{echo '';}
                           if(isset($FaciEle['facilities_changingroom']->element_raw) == 'Yes'){echo '<li class="detail-icon"><i class="fas fa-person-booth"></i><span>Changingroom available</span></li>';}else{echo '';}
                           if(isset($SafeEle['safety_lifeguardstation']->element_raw) == 'Yes'){echo '<li class="detail-icon"><i class="far fa-life-ring"></i><span>Lifeguard station</span></li>';}else{echo '';}
                           if(strlen($FaciEle['facilities_food']->element_raw) == 25){echo '<li class="detail-icon"><i class="fas fa-utensils"></i><span>Food & drinks allowed</span></li>';}else{echo '';}
                           if(strlen($FaciEle['facilities_food']->element_raw) == 15){echo '<li class="detail-icon"><i class="fas fa-utensils"></i><span>Food only allowed</span></li>';}else{echo '';}
                           if(strlen($FaciEle['facilities_food']->element_raw) == 16){echo '<li class="detail-icon"><i class="fas fa-utensils"></i><span>Drinking allowed</span></li>';}else{echo '';}
                           if(isset($FaciEle['facilities_runningwater']->element_raw) == 'Yes'){echo '<li class="detail-icon"><i class="fas fa-shower"></i><span>Running water available</span></li>';}else{echo '';}
                           if(isset($FaciEle['facilities_cooking']->element_raw) == 'Yes'){echo '<li class="detail-icon"><i class="cooking"></i><span>Cooking allowed</span></li>';}else{echo '';}
                       ?>
                   </ul>
               </div>
           </div>
       </div>
  </div>
  {tab General}
   <div class="tab-main tab-general">

  </div>
{/tabs}
</div><!-- //BUWB Detail Template Layout -->

<?php
echo $this->pluginbottom;
echo $this->loadTemplate('actions');
echo '{SCFacebookComments}';
echo '</div>';
echo $form->outro;
echo $this->pluginend;

fabrik-tut-display.jpg

Had to shorten the codes because the post is limited to 10,000 characters.
 
Here are also ideas to have in detail-view template:

Link to edit your detail view:
<a href="index.php/inputsupplierall/form/15/<?php echo $id;?>">EDIT</a>

Thumbnail link to original photo:

<a target="_blank" href="index.php/photo3all/details/17/<?php if (substr($i570, 0, 1) != "/") {echo "92";} else {echo $i570r;}?>">
<img src="th<?php if (substr($i570, 0, 1) != "/") {echo $i570b;} else {echo $i570;}?>" alt="Photo3">

Link from a calendar month to all inputs from that month: (<?php $Monthr = (int)date("m",strtotime($Monthr));)?>
<a href="index.php/farminputsall/list/18/?mis_farm_in___month=<?php echo $Monthr;?>&limitstart18=0&resetfilters=0&fabrik_incsessionfilters=0"
class="w3-bar-item w3-button w3-mobile">Inputs ></a>

Please share many ideas and fedback,
 
That works, but for my situation, it would be too much. I should have mentioned that for the detail template, I'm not yet finished. I have to add the conditional statements for each which would stop the ones that are empty (no answer in fields) to not display, instead of displaying labels with no answers. I had to shorten by deleting some of the file codes in order to make it post because of the forum's posting limit. I figure that once I add those codes to hide the empty elements, it will add about another 50% of characters to the file.

Also, I wanted the buttons from the original template. With your codes, only a link would show and sure they can be styled as buttons, but I was already satisfied the default button styling.

I should mention also that this form is actually a survey with about 120 elements/questions.
 
Oh yea. I almost forgot that I created a list template for a text/link only module. Like the main list template, I created a separate template folder just for the module type, copying the files from my custom template. Except this time, it's not just the default_row.php that is edited, but also the default.php.

I think also, that there are a lot of other things that could be stripped out of the file. I just removed the least as possible, but will revisit it later to remove all the unnecessary codes.

list-textmod/default_row.php

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 : '';
?>
<li class="<?php echo $rowClass; ?> module-li">
<?php foreach ($this->headings as $heading => $label) :
   $d = @$this->_row->data->$heading;

   //skip empty elements but don't skip the checkbox (delete, list plugins)
   $h = $this->headingClass[$heading];
   $c = $this->cellClass[$heading];
   $hStyle = empty($h['style']) ? '' : 'style="' . $h['style'] . '"';
   $cStyle = empty($c['style']) ? '' : 'style="'. $c['style'].'"';
   $bnameData = $this->_row->data->buwb_beaches___beach_name;
   $btownData = $this->_row->data->buwb_beaches___beach_town;
   $bparishData = $this->_row->data->buwb_beaches___beach_parish;


  endforeach;
?>
        <span class="beach-name"><?php echo $bnameData; ?></span>
        <span class="beach-location"><?php echo $btownData . ', ' . $bparishData; ?></span>
</li>

Note: I plan on putting the rating score sometime later.

list-textmod/default.php

PHP:
<?php
/**
 * Fabrik List Template: Div
 *
 * @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');

// The number of columns to split the list rows into
$columns = 1;

// Show the labels next to the data:
$this->showLabels = false;

// Show empty data
$this->showEmpty = true;

$pageClass = $this->params->get('pageclass_sfx', '');

if ($pageClass !== '') :
   echo '<div class="' . $pageClass . '">';
endif;

?>

<?php if ($this->tablePicker != '') { ?>
   <div style="text-align:right"><?php echo FText::_('COM_FABRIK_LIST') ?>: <?php echo $this->tablePicker; ?></div>
<?php }

if ($this->params->get('show_page_heading')) :
   echo '<h1>' . $this->params->get('page_heading') . '</h1>';
endif;

if ($this->showTitle == 1) { ?>
   <h1><?php echo $this->table->label;?></h1>
<?php }?>

<?php echo $this->table->intro;?>
<form class="fabrikForm" action="<?php echo $this->table->action;?>" method="post" id="<?php echo $this->formid;?>" name="fabrikList">


<div class="fabrikDataContainer" data-cols="<?php echo $columns;?>">

<?php foreach ($this->pluginBeforeList as $c) {
   echo $c;
}?>
<div class="fabrikList" id="list_<?php echo $this->table->renderid;?>" >

   <?php
   $gCounter = 0;
   foreach ($this->rows as $groupedBy => $group) :?>
   <?php
   if ($this->isGrouped) :
       $imgProps = array('alt' => FText::_('COM_FABRIK_TOGGLE'), 'data-role' => 'toggle', 'data-expand-icon' => 'fa fa-arrow-down', 'data-collapse-icon' => 'fa fa-arrow-right');
   ?>
   <div class="fabrik_groupheading">
       <?php echo $this->layoutGroupHeading($groupedBy, $group); ?>
   </div>
   <?php
   endif;
   ?>
   <ul class="fabrik_groupdata beach-list">
   <?php

   $items = array();
   foreach ($group as $this->_row) :
       $items[] = $this->loadTemplate('row');
   endforeach;
   $class = '';
   echo FabrikHelperHTML::bootstrapGrid($items, $columns, $class, true, $this->_row->id);

   ?>
   </ul>
   <?php
   endforeach;
?>

</div>
<?php
echo $this->nav;
print_r($this->hiddenFields);?>
</div>

</form>
<?php
echo $this->table->outro;

if ($pageClass !== '') :
   echo '</div>';
endif;
?>

fabrik-tut-list-module.jpg
 
This code is very Good!As sample code for output element data :
$BasicInfo = $this->groups['Basic Info'];
$BasiEle = $BasicInfo->elements;

<?php echo $BasiEle['beach_town']->element_raw; ?>

Could someone tell me how to output element label?
Thanks!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top