1. ggaillet
  2. Support
  3. Tuesday, March 08 2016, 03:32 AM
Is there a way to add more than 6 columns in the user list menu item?
Thanks.
admin Accepted Answer
Admin
Hi,
yes this is possible, but require PHP knowledge. You can override list templates:
- Copy file from /components/com_jsn/views/list/tmpl/table.php into /templates/your-template-folder/html/com_jsn/list/table.php
- Copy file from /components/com_jsn/views/list/tmpl/table_user.php into /templates/your-template-folder/html/com_jsn/list/table_user.php

Now you can customize your new files.

Keep in mind that tables do not adapt well to responsive layouts, many columns ruin viewing on phones.
  1. more than a month ago
  2. Support
  3. # 1
ggaillet Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
Hi,
this override changes only frontend output, you can't change menu item options (otherwise when you update Easy Profile you will lost all changes).

You need to add in your overrides static code. Example to add column for field "interests":
- in file /templates/your-template-folder/html/com_jsn/list/table.php you need to add table header, so at after line 70 you can add something like this:
echo('<th>Interests</th>');

- in file /templates/your-template-folder/html/com_jsn/list/table_user.php you need to add user field, so at after line 136 you can add something like this:
<td>	
<?php echo $this->user->getField('interests',true); ?>
</td>
  1. more than a month ago
  2. Support
  3. # 3
ggaillet Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 4
admin Accepted Answer
Admin
Hi,
there are different way to do this, Joomla template override allow you also to create many views (menu item type), but this is a bit complex.

You can simply use a single override and add some control, for example you have 2 menu items of type Easy Profile->User List (table)
- "List 1" with ID 201
- "List 2" with ID 202

now you can simply change the code like this:
- in file /templates/your-template-folder/html/com_jsn/list/table.php after line 70 you can add something like this:
if ( JRequest::getVar( 'Itemid' ) == 201 ) {
echo('<th>Field A title</th>');
echo('<th>Field B title</th>');
}
if ( JRequest::getVar( 'Itemid' ) == 202 ) {
echo('<th>Field C title</th>');
echo('<th>Field D title</th>');
}

- in file /templates/your-template-folder/html/com_jsn/list/table_user.php after line 136 you can add something like this:
<?php if ( JRequest::getVar( 'Itemid' ) == 201 ) : ?>
<td>
<?php echo $this->user->getField('fieldA',true); ?>
</td>
<td>
<?php echo $this->user->getField('fieldB',true); ?>
</td>
<?php endif; ?>
<?php if ( JRequest::getVar( 'Itemid' ) == 202 ) : ?>
<td>
<?php echo $this->user->getField('fieldC',true); ?>
</td>
<td>
<?php echo $this->user->getField('fieldD',true); ?>
</td>
<?php endif; ?>
  1. more than a month ago
  2. Support
  3. # 5
ggaillet Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.