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

After February 6, this site will no longer have Facebook, Twitter, or OpenID sign-in options. Read our announcement about social media SSO support in 2.8 for more info.

Make sure you have a current, valid email address set in your profile and set a password so you can login without it. If you get locked out after that time, you can choose "Forgot Password" to fix it as long as a valid email is on your account.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

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.