Z
Z
z_u_l2018-06-26 23:37:24
1C-Bitrix
z_u_l, 2018-06-26 23:37:24

How to display a bulleted list from the admin panel in Bitrix?

In the infoblock, I created the ATT_DSC_RATE property of the HTML/text type.
5b32a3ede4b96851696036.png
I tried to display it like this, but the entire description is displayed in one li. Is it possible to do something so that with each new line there is a new li? Or are bulleted lists generally done differently?

<ul>
  <?foreach($arItem["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?> 
    <?if($pid =="ATT_DSC_RATE"): ?> 	
      <li><?echo $arProperty["DISPLAY_VALUE"];?></li> 
    <?endif?> 
  <?endforeach;?>
</ul>

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vasya, 2018-06-27
@z_u_l

Why not initially store the layout of the list in the field itself?
Well, if you need to pervert, then so be it.

<ul>
  <?
   $text = $arItem["DISPLAY_PROPERTIES"]["ATT_DSC_RATE"]["DISPLAY_VALUE"];
   $lines = explode("\n", $text);
  ?> 
   <?foreach($lines as $line): ?> 
      <?if(trim($line) != ""):?>	
            <li><?echo $line;?></li> 
      <?endif?> 
  <?endforeach;?>
</ul>

R
Roman Zhak, 2014-10-14
@romanzhak

javascript.com

O
O_godo, 2014-10-14
@O_godo

www.youtube.com/playlist?list=PLov7vC9M_skJLTh4ghR...
www.youtube.com/watch?v=2YZD6t8Jb78&list=PLov7vC9M...
www.youtube.com/watch?v=dOAWLkT3J88&list=PLov7vC9M...
Clear and understandable

D
Dmitry Ermolaev, 2014-10-14
@iusfof

Sorax - VK
Sorax - youtube

R
rinatoptimus, 2015-09-22
@rinatoptimus

It helps a lot to analyze ready-made scripts: sliders, animations, etc. Here is one of the resources with ready-made examples: www.cssscript.com/free-javascripts - practice!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question