Styling on the userlist

12 years 2 months ago #74940 by gchancy
Styling on the userlist was created by gchancy
Hello -

Is there any way to style the userlist? I was hoping to put more space between the labels and the data fields. I was able to bold the labels putting a <b> tag in the language file. But, since it's a table, I was hoping I could do more with it on spacing and alignment.

Thanks,

Glen

Please Log in to join the conversation.

12 years 2 months ago #74957 by Rapunzl
Replied by Rapunzl on topic Re:Styling on the userlist
I believe the formatting is in comprofiler.html.php. Remember to back up first.

;)

Jamie (Rapunzl)
Community Builder Team Member

Before posting on forums: Read all CB Articles | Specially the FAQ | Help us help you
CB links: Subscribe to CB documentation | [url=http://www.joomlapolis.com/content/view/7363/37/
]Our templates[/url] | [url=http://www.joomlapolis.com/content/blogcategory/61/74/
]Paid Subscriptions[/url] | Get Hosting | Our Forge
Visit my CB Profile

My personal site Rapunzl's Reality always under reconstruction

Please Log in to join the conversation.

12 years 2 months ago #75112 by gchancy
Replied by gchancy on topic Re:Styling on the userlist
Rapunzl wrote:

I believe the formatting is in comprofiler.html.php. Remember to back up first.

;)


Hey Rapunzel -

You are very nice.

Thanks. I looked up the code, but I'm not sure what to do with it. I would like to align the data to the right to provide spacing between the label fields and the data. Currently, the userlist isn't very readable as the formatting is like below:

Name: Glen
Place of business: Orlando

I'm trying to get to look like this:

Name: Glen
Place of Business: Orlando

I'd have no problem doing that in HTML (of course), but I'm at a loss how to do this in the php. Here is the code I think is involved in the generation of the Userlist fields:


function getUserListCell( &$user, &$column, &$fields ) {
global $_PLUGINS;

$html = array();

foreach ( $column->fields as $fieldId ) {
$field = $fields[$fieldId];

$value = $_PLUGINS->callField( $field->type, 'getFieldRow', array( &$field, &$user, 'html', 'none', 'list' ), $field );

if ( $value !== null ) {
$title = '';
if ( $column->captions ) {
$title = '<span class="cbUserListFieldTitle cbUserListFT_' . $field->name . '">'
. $_PLUGINS->callField( $field->type, 'getFieldTitle', array( &$field, &$user, 'html', 'list' ), $field )
. ':'
. '</span> ';
}
// done at db query stage: $oField->params = new cbParamsBase( $oField->params );
$html[] = '<div class="cbUserListFieldLine">'
. $title
. '<span class="cbListFieldCont cbUserListFC_' . $field->name . '">'
. $value
. '</span>'
. '</div>';
}
}
return "\n\t\t\t\t" . implode( "\n\t\t\t\t", $html ) . "\n";
}

Does anyone have a recommended solution for how to improve the alignment?

Thanks,

Glen

Please Log in to join the conversation.

12 years 1 month ago #78131 by Raller
Replied by Raller on topic Re:Styling on the userlist
I inserted a <hr> for each usre:


near line:887

echo "\t\t\t<td valign='top'>" . '<hr>' . HTML_comprofiler::getUserListCell( $user, $column, $allFields, $option_itemid ) . "</td>\n"; // vdLi


Here I inserted <i> ....... </i>

near line 928:

foreach ( $column->fields as $fieldId ) {
$field = $fields[$fieldId];
$name = $field->name;
$title = "";

if ( $column->captions ) {
// $title = getLangDefinition( $field->title ) . ': '; // vdLi
$title = '<i>' . getLangDefinition( $field->title ) . '</i>: '; // vdLi
}
$html[] = getFieldValue( $field->type, $user->$name, $user, $title, 0,
( $field->type=="predefined" ? sefRelToAbs("index.php?option=com_comprofiler&amp;task=userProfile&amp;user=" . $user->id . $option_itemid ) : null ) );
}
return implode( '<br />', $html );
}

Gruß
Raller

Please Log in to join the conversation.

12 years 1 week ago #80663 by chrisyork
Replied by chrisyork on topic Re:Styling on the userlist
Raller wrote:

near line:887

echo "\t\t\t<td valign='top'>" . '<hr>' . HTML_comprofiler::getUserListCell( $user, $column, $allFields, $option_itemid ) . "</td>\n"; // vdLi


This has got to be one of the most useful simple changes that could be implemented!!!!

As if by magic you can see a list with each user separated by a line - why is this not standard? With a long user list, it can get confusing which user you are reading about!

Can I recommend that this is added to newer versions. Thanks Raller!

Of course there is lots that can be done in the way of formatting of lists, but this is SO important for anyone that has any visual impairment.

Please Log in to join the conversation.

12 years 1 week ago #80665 by nant
Replied by nant on topic Re:Styling on the userlist
I am sure you can accomplish the same by changing your template css file.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.422 seconds

Facebook Twitter LinkedIn