Difference between revisions of "How to display field values in columns"

From JReviews Documentation
Jump to: navigation, search
m
Line 22: Line 22:
 
}
 
}
 
</source>
 
</source>
 +
  
 
Field values now look like this:
 
Field values now look like this:
Line 29: Line 30:
  
 
If you want only certain field to display in a column, add a field name in front of the selector, for example:
 
If you want only certain field to display in a column, add a field name in front of the selector, for example:
 
  
 
<source lang="css">
 
<source lang="css">

Revision as of 10:33, 23 August 2011

With Multiple Select List and Checkbox custom field types, the fields can have many values. On the listing detail page those values are displayed in the same line separated by bullets.

Example:

FieldColumns1.png


Instead of the values being separated by bullets, you can display them as a list in one or more columns.

To do that, add this code to the custom_styles.css file in your theme:

ul.fieldValueList li { 
    margin-right: 5px !important; 
    float: left; 
    width: 90%; 
} 
ul.fieldValueList li:after{ 
    content:''; 
    padding:0; 
}


Field values now look like this:

FieldColumns2.png


If you want only certain field to display in a column, add a field name in front of the selector, for example:

.jr_actors ul.fieldValueList li {
    margin-right: 5px !important;
    float: left;
    width: 90%;
}
.jr_actors ul.fieldValueList li:after{
    content:'';
    padding:0;
}


To display field values in two columns, reduce the list item width to 45%:

ul.fieldValueList li { 
    margin-right: 5px !important; 
    float: left; 
    width: 45%; 
} 
ul.fieldValueList li:after{ 
    content:''; 
    padding:0; 
}


Now it looks like this:

FieldColumns3.png


To display field values in three columns, decrease the width to around 30%.

Percentages depend on the css of your Joomla template. Use Firebug to find the best value.