TOPIC:

Smartphone: contentBuilder list in the Frontend -> more than 2 ELements 1 year 7 months ago #234863

  • Topic Author
  • rd
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 202
  • Thanks: 2
Hello,

we have several forms that are displayed via contenbuilder list view in the frontend. On the desktop version all elements are shown and the list scrolls horizontally.

On the smartphone only 2 Elements are shown.

Is there a way to change this view and show more than these two elements?
And how can we change the display of the list to scroll horizontally?

Thank you
Rolf

Please Log in or Create an account to join the conversation.

Smartphone: contentBuilder list in the Frontend -> more than 2 ELements 1 year 7 months ago #234938

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

First, to show all columns in the mobile view as well, please do as follows.

Navigate to Joomla root\components\com_contentbuilder\views\list\tmpl\ and open the default.php file that you find there.

Around the line 544, you should see this part of the code :
$hidden = ' class="hidden-phone"';
            foreach($row As $key => $value){
                // filtering out disallowed columns
                if(in_array(str_replace('col','',$key), $this->visible_cols)){
                    if($label_count == 0){
                        $hidden = '';
                    }else{
                        $hidden = ' class="hidden-phone"';
                    }
In that piece of code remove both instances of hidden-phone.

That will make the other element values visible as well.

If you wish to show the element's titles as well, do the following. Around line 373 you will see this piece of code:
if($this->labels){
                $label_count = 0;
                $hidden = ' hidden-phone';
                foreach($this->labels As $reference_id => $label){
                    if($label_count == 0){
                        $hidden = '';
                    }else{
                        $hidden = ' hidden-phone';
                    }
In the code delete both instances of class hidden-phone.

That will resolve the part with showing other columns.

To set the view to be able to scroll horizontally, go to List View and in the View tab under Item wrap code column for of any element in the List view paste the following code:
<?php echo '<style> cbListView .table .hidden-phone { display: flex !important; }  .cbListView .table {     display: block !important;     overflow-x: scroll !important; width: 100% !important; } </style>';?>
Save the change and that should do the trick.

Let me know whether it works as you wanted after applying the changes suggested.

Regards,

Mihaela
The following user(s) said Thank You: Gilles361

Please Log in or Create an account to join the conversation.

Smartphone: contentBuilder list in the Frontend -> more than 2 ELements 1 year 6 months ago #235168

  • Topic Author
  • rd
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 202
  • Thanks: 2
Thank you, Mihaela, works perfect, if we would like to see all elements. I guess this is a default that works for all forms that we use together with contentbuilder, right?

Is there a way to define a template for each form? Like we can do with pdf-templates or mail-templates? It would be great to say e.g. form 1-3 : display all columns. Form 4: only 3 selected columns. And Form 5: 2 selected columns.

If this is not possible to define a view-list-template for each form, can we show only certain columns and not all?

And, last question, how can the Edit Checkboxes and the Status-Field shown in the Mobile View as well?

Btw. Scrolling horizontally works without changing the code :-)

Again, thank you so much for your help
Regards
Rolf

Please Log in or Create an account to join the conversation.

Smartphone: contentBuilder list in the Frontend -> more than 2 ELements 1 year 6 months ago #235210

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello again,

I'm glad I've helped.

Regarding the new request, I understand what you want to achieve, but there is not a way to define the template for each form so that different columns are displayed for different views. Maybe it could be done by changing the core fields, but that is out of the scope of our support.

You can hide certain columns by simply not including some fields in that view.
If you wish to include all these fields in the form, but you do not want to show the column corresponding to that field in the mobile, you can remove the column by doing as follows.

Go to List View and in the View tab under Item wrap code column for of any element in the List view paste the following code:
<?php echo '<script>  jQuery(document).ready(function () { 	jQuery("table.category.table.table-striped tbody tr").each(function() {     	jQuery(this).find("td:eq(6)").addClass("hidden-phone"); 		}); 

 jQuery("table.category.table.table-striped thead tr").each(function() {     	jQuery(this).find("th:eq(6)").attr("class", "sectiontableheader hidden-phone");		});  	  }); </script>'; ?>

This is an example of a code that will hide the 4th column, that is the column corresponding to the 4th element in the view.

That is as far as I can suggest regarding customization of view.

Here you can add more code if you wish to style the view.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.092 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!