1. mr412
  2. General
  3. Wednesday, May 01 2019, 08:47 AM
Hi
How can I format a list field like <ul><li></li></ul> ?
Thanks in advance =)
admin Accepted Answer
Admin
Hi,
you can use Joomla Template override feature, for example for profile page:
- Copy file from /components/com_jsn/views/profile/tmpl/default_fields.php at /templates/your-theme-folder/html/com_jsn/profile/default_fields.php
- Edit new file and replace HTML structure from DL,DT,DD to UL,LI
  1. more than a month ago
  2. General
  3. # 1
mr412 Accepted Answer
Thanks. Thats not what I mean. See please the image the column "Lehrbetrieb" this is a output from a selectlist... the output is not DL, DD.. the output is just the list in plaintext.. and I need to have "ul/li"
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Ok, now I have understood, try with these steps:
- Copy file from /components/com_jsn/views/list/tmpl/table_user.php at /templates/your-theme-folder/html/com_jsn/list/table_user.php
- Edit new file and replace all occurrences of
<?php  echo $this->user->getField($field,true); ?>
with this code
<?php if( is_array( $this->user->getValue( $field ) ) ) { echo '<ul><li>'.implode( '</li><li>',$this->user->getValue( $field ) ).'</li></ul>'; } else { echo $this->user->getField( $field, true ); } ?>


Basically if the raw value of the field is an array then it will be displayed like HTML list.
  1. more than a month ago
  2. General
  3. # 3
mr412 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 4
mr412 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 5
admin Accepted Answer
Admin
Hi,
sorry for late reply, try with this code:
<?php if( is_array( $this->user->getValue( $field ) ) ) { echo '<ul><li>'.implode( '</li><li>',explode( ',' , $this->user->getField( $field ) ) ).'</li></ul>'; } else { echo $this->user->getField( $field, true ); } ?>
  1. more than a month ago
  2. General
  3. # 6
  • Page :
  • 1


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