Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
935 views
in Q2A Core by
Below the CKEditor I want to leave my users a message, for instance "You can upload an image to make your post more appealing."

Problem is that with advanced theme I cannot change the ask page.

And the admin option to add an extra field to the ask page ... the field is on very top. I need it below the editor window.

How would you do it?
Q2A version: 1.6.2

1 Answer

0 votes
by

If I am you, I will add function below to my theme.php.

function form($form) {
  if($this->template == 'ask' && isset($form['fields'])) {
    // echo '<pre>';
    // echo 'Before fields = '.print_r($form['fields'],true).PHP_EOL;
    // echo '</pre>';
    $newitems = array();
    foreach($form['fields'] as $key => $field) {
      if($key == 'custom')
        $custom = $field;
      else
        $newitems[$key] = $field;
      if($key == 'content')
        $newitems['custom'] = $custom;
    }
    $form['fields'] = $newitems;
    // echo '<pre>';
    // echo 'After fields = '.print_r($form['fields'],true).PHP_EOL;
    // echo '</pre>';
  }
  qa_html_theme_base::form($form);
}
by
I don't understand this code, and it did not work for me. Where to put my <p> tag information?

But thanks for pointing out $form['fields']... I tried, but does not work yet:

    // add extra label on ask page
    function form($form)
    {
        // added label
        if($this->template == 'ask' && isset($form['fields'])) {
            $form['fields']['custom2'] = array(
                'type' => 'static',
                'label' => 'TEST ###',
                'value' => '123',
            );
        }
        qa_html_theme_base::form($form);
    }

What am I doing wrong?
by
To inspect the correctness of my code,, you must input something in posting option.
Admin > Posting > "Custom message on ask form - HTML allowed:"
...