Insert line breaks after every attribute?

Permalink
Hello,
so far I'm mostly trying to comprehend and reproduce the demo content. Now, if I select several attributes (e.g. skills) they are shown on the portfolio project page in a row.
Is it possible to wrap each value separately or insert a line break between each one?
I took a look at the controller file, alas I do not have any php skills worth mentioning.

 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi Trichter,

Someone had a similar question a few months ago. They wanted a comma separator between attributes. I believe the custom template I made would work for you if you replaced the comma with a <br> tag.
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
echo $controller->getOpenTag();
echo "<span class=\"ccm-block-page-attribute-display-title\">".$controller->getTitle()."</span>";
$tasks = $controller->getContent();
$task_list = array();
foreach ($tasks as $task) {
     $task_list[] = $task;
}
$i = 0;
while (count($task_list) > $i) {
    echo $task_list[$i];
    if ($i != count($task_list) - 1) {
        echo '<br>';
    }

http://www.concrete5.org/community/forums/customizing_c5/page-attri...
Trichter replied on at Permalink Reply
Thank you, overlooked that question. Now, modified your code a bit since I got either an "Invalid argument supplied for foreach()" error or some other attributes (topics are already getting separated by commas?) weren't displayed at all.
So far, the topics are just a few characters of length each, so this seems to do the trick:

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
echo $controller->getOpenTag();
echo "<span class=\"ccm-block-page-attribute-display-title\">".$controller->getTitle()."</span>";
$tasks = $controller->getContent();
if (is_array($tasks) || is_object($tasks))
{
$task_list = array();
foreach ($tasks as $task) {
     $task_list[] = $task;
}
$i = 0;
while (count($task_list) > $i) {
    echo $task_list[$i];
    if ($i != count($task_list) - 1) {