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.
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.
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:
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) {
Viewing 15 lines of 24 lines. View entire code block.
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.
http://www.concrete5.org/community/forums/customizing_c5/page-attri...