Hide a column only if a label is..

frullix

New Member
Hide a column only if a label of list view is equal a data ( Competizione: )

if label == "Competizione:" hide column on the under table
upload_2020-9-28_11-20-55.png

Is it possibile?
 

Attachments

  • upload_2020-9-28_11-15-1.png
    upload_2020-9-28_11-15-1.png
    14.9 KB · Views: 70
Last edited:
Where is this "Cerca: / Competizione: ..." header coming from? Is it another lists details view in you list intro using content plugin?
 
Is the label of the table in the list view.
I want hide this column only in this view, because in the other view I want view this column.
And the label is the only difference with the other views.
 
Last edited:
If you are calling this list via a Fabrik list menu you can set the columns to show in "Fabrik list options" "Show in list".
 
If you are calling this list via a Fabrik list menu you can set the columns to show in "Fabrik list options" "Show in list".
Yes, I know, but I've two list with the same results and in a one of this (Competizione) I want hide the Competizione column and the difference is only the name of label.
 
Last edited:
I think like this:

if (fabrik_elements.label == "Competizione:" ) {
$class = "hide_column";
}

*******
css

.hide_column {
.scheda_atleta___partecipazione_competizioni
display:none;
}

But don't work
 
I've two list with the same results
As always for CSS: Use your browser console to get the correct CSS classes and add custom CSS, something like
#list_X_com_fabrik_X .scheda_atleta___partecipazione_competizioni {display:none;}
X = your list id
 
As always for CSS: Use your browser console to get the correct CSS classes and add custom CSS, something like
#list_X_com_fabrik_X .scheda_atleta___partecipazione_competizioni {display:none;}
X = your list id
I try with add custom Css but hides the column "Competizione" in both views [list_4_com_fabrik_4] for the two view.

This is the first view: (in this view I don't want the column COMPETIZIONE)
upload_2020-10-1_18-24-38.png
and this the second: (in this view, I want the Competizione column, but not the Atleta column)
upload_2020-10-1_18-25-33.png

the list is number four for the two list and the unique difference is "Competizione or Atleta"
 
Last edited:
So you don't have two lists but one list with different views?

How do you call these two list views:
Via menu item, Fabrik list module, content plugin ...? All these have options to set the elements to show in list view (so unwanted columns are not rendered at all)

Resp:
All these have different HTML ids/CSS classes somewhere in the page source to hide the columns via CSS.
 
So you don't have two lists but one list with different views?

How do you call these two list views:
Via menu item, Fabrik list module, content plugin ...? All these have options to set the elements to show in list view (so unwanted columns are not rendered at all)

Resp:
All these have different HTML ids/CSS classes somewhere in the page source to hide the columns via CSS.

Yes, one list with different views with a joined data! The only difference i found is the label (Competizione and Atleta)
 
Search ATLETA -> list of competitions in which he participated -> click on competition-> list of all participants in that competition

it's a bit complicated to explain
You can try here: www.skatingscore.it with for example "Frangipani"
 
I just tried and can create what you call here the "first view", but can't get to what you show as "second" list.
But indeed, per CSS it is difficult to impossible because it is the same list, ID, classes etc, the way you access them.

So, back to what @troester mentioned multiple times already:
You have two menu items, one seems to be the homepage (Cerca Atleta), the other has the alias "cerca-competizione":
Screenshot of Google Chrome (2-10-20, 02-09-49).png

As troester said, edit both these menu items and in the tab "Advanced Options" use "Show in list" to select the elements you want to see in each "view" (and, obviously, do not select Competizione in one and Atleta in the other, respectively).
http://fabrikar.com/forums/index.php?wiki/menu-items/#list
 
Last edited:
As far as I can see you are using two Fabrik search forms (id 20/Itemid123 and id 22/Itemid 141).
Include the Itemids in your redirects (&Itemid=123) then you'll get them as CSS class (itemid-123) in the body tag.
 
As far as I can see you are using two Fabrik search forms (id 20/Itemid123 and id 22/Itemid 141).
Include the Itemids in your redirects (&Itemid=123) then you'll get them as CSS class (itemid-123) in the body tag.
Hi troester, I tried with Itemids, but don't work, because when you jump from link to link the Itemids not show in the body tag.
 
If set in the redirect plugin it's definitivly in the body tag of the list view directly after the search form (i.e. your competition result list)

But you also can
  • do complex JS grabbing the label from the filter and then injecting the classed in th and td
  • create a hidden menu item for the competition result, set the columns to show in menu settings and use it as jump url
  • create a list copy, set columns to show in list settings
  • ...
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top