Page 1 of 1

Changing title color

Posted: 20 Feb 2012, 17:28
by rien
Joomla 2.5.1
Phoca Guestbook 2.0.5

Hi all,
I tried to change the color of the message title.

In components/com-phocaguestboek/assets/phocaguestbook.css I changed the following code:

Code: Select all

#phocaguestbook .pgtitle {
	padding:	8px;
	margin:	2px;
}
to

Code: Select all

#phocaguestbook .pgtitle {
	padding:	8px;
	margin:	2px;
   color:  #ffffff;
}
But this hasn't effect at all!

How can I change the title color?

Thanks,

Rien
(The Netherlands)

Re: Changing title color

Posted: 22 Feb 2012, 00:22
by Jan
Hi, color can be set in parameters.

To customize it, directly the php code needs to be customized:

components\com_phocaguestbook\views\guestbook\tmpl\default.php

Jan

Re: Changing title color

Posted: 03 Jun 2012, 17:40
by boebel
For all who are interested (me included ;-)):
The reason why the css properties "background-color" and "color" not work is because these properties are "hardcoded" by php script. If you take a look at the html source code from your own phocaguestbook site, you can see for each title in each guestbook item (message) the following html code:

Code: Select all

<h4 class="pgtitle" style="background:#A61F20;color:#000000;">title of message</h4>
the easiest way: change color via joomla webinterface
select components =>Phoca Guestbook => Control Panel
click on "Options" (you can find it in the upper right corner)
select the tab "Post"
choose a color for "Font Color" and click "save". you're done.

But this can be a problem, because not only the color of title changes, but also the color of message text too. If you set a dark background color, the title is difficult to read.

as jan already said, to change the title color only, you must edit this by hand in following file:
components\com_phocaguestbook\views\guestbook\tmpl\default.php

search for "pgtitle" and you find following line (in my file there is line 127):

Code: Select all

$gbPosts .= '<h4 class="pgtitle" style="background:'.$this->tmpl['background_color'].';color:'.$this->tmpl['font_color'].';">';
You can edit this line to change the color. After that, the title color can not be changed via the web interface.

First way: you can replace the php code with a html color code. example with white title color:

Code: Select all

$gbPosts .= '<h4 class="pgtitle" style="background:'.$this->tmpl['background_color'].';color:#FFFFFF;">';
Second way: you can remove the php code for text color, like this

Code: Select all

$gbPosts .= '<h4 class="pgtitle" style="background:'.$this->tmpl['background_color'].';">';
and set the color property in the css file /components/com_phocaguestbook/assets/phocaguestbook.css. Look for

Code: Select all

#phocaguestbook .pgtitle {
	padding:	8px;
	margin:		2px;
}

and add the color property. example:

Code: Select all

#phocaguestbook .pgtitle {
	padding:	8px;
	margin:		2px;
	color:	#FFFFFF;
}

I think the second way is an elegant solution.

Michael

Re: Changing title color

Posted: 13 Jun 2012, 22:09
by Jan
Hi, thank you for this guide.

Jan

Re: Changing title color

Posted: 17 Mar 2017, 12:04
by marcel77
Hi all,

I think, something changes on this? I canĀ“t found /components/com_phocaguestbook/assets/phocaguestbook.css .

I see, that parameters for first to third font are asked in sourcecode. But not where defined?

Marcel

Re: Changing title color

Posted: 18 Mar 2017, 22:22
by Jan
Hi, in newest Joomla! versions, the CSS is stored in media folder:
media\com_phocaguestbook\css\phocaguestbook.css

Jan

Re: Changing title color

Posted: 19 Mar 2017, 01:13
by marcel77
Ah ok! Thanks a lot Jan.

cheers Marcel