Changing title color

Phoca Guestbook - creating guestbooks in Joomla! CMS
rien
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 20 Feb 2012, 17:12

Changing title color

Post 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)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Changing title color

Post 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
If you find Phoca extensions useful, please support the project
boebel
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 03 Jun 2012, 15:57
Location: Zurich, Switzerland

Re: Changing title color

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Changing title color

Post by Jan »

Hi, thank you for this guide.

Jan
If you find Phoca extensions useful, please support the project
marcel77
Phoca Enthusiast
Phoca Enthusiast
Posts: 79
Joined: 22 Apr 2016, 12:03

Re: Changing title color

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Changing title color

Post by Jan »

Hi, in newest Joomla! versions, the CSS is stored in media folder:
media\com_phocaguestbook\css\phocaguestbook.css

Jan
If you find Phoca extensions useful, please support the project
marcel77
Phoca Enthusiast
Phoca Enthusiast
Posts: 79
Joined: 22 Apr 2016, 12:03

Re: Changing title color

Post by marcel77 »

Ah ok! Thanks a lot Jan.

cheers Marcel
Post Reply