How Do You Change Textarea Box Size? [SOLVED]

Phoca Guestbook - creating guestbooks in Joomla! CMS
stanhook
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 01 Dec 2008, 23:51

How Do You Change Textarea Box Size? [SOLVED]

Post by stanhook »

Hi,

I have disabled the TinyMCE text editor so I could have a plain box. But the box is too large and I need to make it smaller. I have changed the settings in parameters, tried changing the view.html.php file and some others. I have poked around and changed other stuff only to come up empty. Could you please point me in the right direction?

Thanks!

Stan
Last edited by stanhook on 02 Dec 2008, 19:32, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48689
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How Do You Change Textarea Box Size ?

Post by Jan »

Hi, try to set the table width too (in parameters component)


this is the code for displaying the textarea:

Code: Select all

if ($tmpl['enableeditor'] == 1) {
			$editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
		} else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
		
		}
in
components\com_phocaguestbook\views\phocaguestbook\view.html.php

Jan
If you find Phoca extensions useful, please support the project
stanhook
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 01 Dec 2008, 23:51

Re: How Do You Change Textarea Box Size ?

Post by stanhook »

Hi Jan,

I changed your the cols attribute code in the view.html.php to this:

Code: Select all

if ($tmpl['enableeditor'] == 1) {
			$editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
		} else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="5" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
		
		}
and I changed the default.php in the tmpl folder to:

Code: Select all

<table border="0" style="margin-left: 40px;" width="350px">
but still no luck. I have spent half a day and my mind is melting. I had tried some code that suggested to change the textarea totally but then I had other issues.

By the way, the parameters in the backend are set to text editor no and the table and editor width and height to 100px. Still no effect.

In the view.html.php page should I change the style=width also?

What am I missing?
stanhook
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 01 Dec 2008, 23:51

Re: How Do You Change Textarea Box Size ?

Post by stanhook »

If got it fixed. Here is what I did:

I used this code in the view.html.php page:

Code: Select all

if ($tmpl['enableeditor'] == 1) {
			$editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
		} else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
		
		}
and changed the $editor = '<textarea ... to this:

Code: Select all

 else {
			$editor = '<textarea id="pgbcontent" name="pgbcontent" cols="5" rows="10" style="width: 300px; height:200px;" >'.$formdata->content.'</textarea>';
		
		}
I don't know if the cols and row attribute matter. But it was the width and height that fixed my issue.

Thanks Jan for pointing me in the right direction.

Stan
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48689
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How Do You Change Textarea Box Size? [SOLVED]

Post by Jan »

great to hear it, Jan
If you find Phoca extensions useful, please support the project
slymndvc
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Dec 2008, 22:27

Re: How Do You Change Textarea Box Size? [SOLVED]

Post by slymndvc »

Hi,

I was looking for how to change the dimentions of the text area and find this post, but my situation is TinyMCE enabled. I have changed the parameters from the backand but nothing changed. I have also tried to change the code written above post, but couldn't get any result.

Code: Select all

    if ($tmpl['enableeditor'] == 1) {
             $editor = PhocaguestbookHelper::displayTextArea('pgbcontent',  $formdata->content , (int)$tmpl['editorwidth'].'px', (int)$tmpl['editorheight'].'px', '60', '80', false );
          } else {
             $editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
          
          }
Would you please show me what should be changed on the code above to solve the problem given in the attached image?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48689
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How Do You Change Textarea Box Size? [SOLVED]

Post by Jan »

Did you change the pareamters in Parameters Component in menu link to Phoca Guestbook?
If you find Phoca extensions useful, please support the project
slymndvc
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Dec 2008, 22:27

Re: How Do You Change Textarea Box Size? [SOLVED]

Post by slymndvc »

Jan wrote:Did you change the pareamters in Parameters Component in menu link to Phoca Guestbook?
Dear Jan,
Of course, firstly I have tried to change parameters from the component menu, but it didn't work. I think I have to change something from below, but not sure where;

Code: Select all

   } else {
             $editor = '<textarea id="pgbcontent" name="pgbcontent" cols="45" rows="10" style="width: '.(int)$tmpl['editorwidth'].'px; height:'.(int)$tmpl['editorheight'].'px;" >'.$formdata->content.'</textarea>';
         
          }
I have used the code below (which is posted by stan);

Code: Select all

else {
         $editor = '<textarea id="pgbcontent" name="pgbcontent" cols="5" rows="10" style="width: 300px; height:200px;" >'.$formdata->content.'</textarea>';
      
      }
but then I got the error message "Parse error: syntax error, unexpected T_ELSE in /home/eressam/public_html/components/com_phocaguestbook/views/phocaguestbook/view.html.php on line 151"

So, still I need help.

Frienly regards.

Suleyman
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48689
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: How Do You Change Textarea Box Size? [SOLVED]

Post by Jan »

Hi, the parse error is error in php script, somewhere you have lost ; or ) (, try to check your code
If you find Phoca extensions useful, please support the project
Post Reply