Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

How to add line breaks in 'DiscussionExtender' Plugin

Whenever I add discussion options using the 'DiscussionExtender' plugin, it works just fine and as coded.

What I want to add is the ability to add a line break after each added discussion option.

How do I do that? I've tried using code in the discussion option to add a line break but it does not seem to work.

Comments

  • I figure it out. Change the contents of the following function to be following:

    public function DiscussionController_BeforeDiscussionBody_Handler($Sender) {`

     $GlobalTest = $Sender->RequestMethod;
    $Discussion = $Sender->EventArguments['Discussion'];
    $Fields = $this->GetDiscussionFields();
    $FieldAttributes = DiscussionModel::GetRecordAttribute($Discussion, 'ExtendedFields', array());
    $FieldString = '<br>';
    
    foreach ($Fields as $Name => $Field) {
      $ColumnValue = val($Name, $Discussion, FALSE);
      $Value = ($ColumnValue) ? $ColumnValue : val($Name, $FieldAttributes, FALSE);
      if ($Field['Display'] && $Value) {
        $FieldString .= Wrap($Field['Label'], 'dt') . ' ';
        $FieldString .= Wrap($Value, 'dd') . '<br>';
    
      }
    }
    echo WrapIf($FieldString, 'dl', array('class' => 'About'));
    

    }
    `

Sign In or Register to comment.