Forums | Mahara Community

Support /
Is there a way to turn off or change the wording of 'Page description'


Teresa Brady's profile picture
Posts: 33

01 September 2013, 12:22

Hi everyone,

Semester after semester, we have users who put their entire content (including images) into the Page description area. They can't understand why their images don't display when they share thier pages via Secret URL. Their text is visible, just not the images.

Is there a way to turn off the Page description area or change the wording to Page subtitle anywhere in the Administration area? 

Or is there anywhere to maybe limit the number of words in the Page description field? or maybe make the that field only just plain text?

Cheers,
Tess

Kristina Hoeppner's profile picture
Posts: 4859

02 September 2013, 7:51

Hello Teresa,

You can change the wording in the language file or better create your own local language pack so that your change won't be overwritten with the next update. Changing the behavior of the text field itself is a bit trickier, but you could look at the code of the collection description and see if you could replicate that for the page description. The collection description does not yet have a WYSIWYG editor.

Cheers

Kristina

 

Aaron Wells's profile picture
Posts: 896

03 September 2013, 15:49

Hi Kristina,

Maybe we should change the Page Description field from a "wysiwyg" with 10 columns, to a "tinywysiwyg" with 1 column, in order to avoid this confusion?

We don't seem to be using the "tinywysiwyg" form element anywhere in the code at present, but it's a Pieform element that displays a TinyMCE editor with most of the buttons stripped away, conducive for rich text editing in smaller fields. So it'd be backwards-compatible with existing Page descriptions which contain HTML, while at the same time not looking quite so much like it's the Page itself. Wink And it'd be about a two-line code change.

Cheers,

Aaron

Kristina Hoeppner's profile picture
Posts: 4859

04 September 2013, 23:21

Hello Aaron,

So far, the current WYSIWYG came in quite handy because it allowed users to have a wide column across the entire page and then the regular columns. Now that we are going to have  flexible layouts in Mahara 1.8, the need for that will be decreased. I don't quite get what you mean by the 10 columns as I don't see any columns in the editor. It'll be best if you showed me, I think. :-)

Going forward, a stripped down version of the TinyMCE editor may be a good idea to avoid confusion. But I'd like to keep some formatting options because we are ging over to having formatting options on all text areas instead of some having TinyMCE and others not. The collection description and plans are one of the very few text areas that don't have formatting options.

Cheers

Kristina

 

Aaron Wells's profile picture
Posts: 896

03 September 2013, 15:39

Hi Teresa,

I see your point about how confusing the Page Description can be! The Collection Description is probably even more confusing, because that's shown to no one but the Collection owner, and then only on the page that lists their Collections. Tongue Out

As Kristina said, there's no way to change the Page Description via the admin UI. If you're comfortable patching core PHP code, it's a one line change in the code to get rid of it or change it.

In the file htdocs/view/edit.php, on line 109, you'll see the declaration of an array variable called $editview. Within the 'elements' item of that array, you'll see the definition of the Page Description, which looks like this:

        'description' => array(
            'type'         => 'wysiwyg',
            'title'        => get_string('description','view'),
            'rows'         => 10,
            'cols'         => 70,
            'defaultvalue' => $view->get('description'),
            'rules'        => array('maxlength' => 65536),
        ),

If you change the 'type' from 'wysiwyg' (which is what we call a What-You-See-Is-What-You-Get rich text editor) to 'text', it will become a standard text box. You could also shorten its legal size by changing the number 65536 in the code above, which specifies how many characters it is allowed to contain. Or you could just delete the 'description' item altogether. This will cause some "missing array index" warning messages to get printed into your PHP error logs, but if you never look at those logs then you may be willing to live with that. Wink

The above instructions are valid for Mahara 1.6 - 1.8. If you're using 1.5 or earlier, then the $editview variable will be on a different line in the file, but otherwise things are the same.

Cheers,

Aaron

Teresa Brady's profile picture
Posts: 33

12 September 2013, 13:54

Hi Aaron & Kristina, 

Thank you both for your feedback!

Cheers,

Teresa

6 results