Smartphone: contentBuilder list in the Frontend -> more than 2 ELements

  • rd
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 68
  • Thank you received: 2

rd created the topic: Smartphone: contentBuilder list in the Frontend -> more than 2 ELements

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
#234863
  • Posts: 2365
  • Karma: 85
  • Thank you received: 317

mihaela replied the topic: Smartphone: contentBuilder list in the Frontend -> more than 2 ELements

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
#234938
The following user(s) said Thank You: Gilles361
  • rd
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 68
  • Thank you received: 2

rd replied the topic: Smartphone: contentBuilder list in the Frontend -> more than 2 ELements

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
#235168
  • Posts: 2365
  • Karma: 85
  • Thank you received: 317

mihaela replied the topic: Smartphone: contentBuilder list in the Frontend -> more than 2 ELements

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
#235210
Moderators: ForumSupporttomeperica
Time to create page: 0.069 seconds

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans & templates!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here