×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Changing the background of comment boxes

Changing the background of comment boxes 12 years 11 months ago #12061

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
So I developed an Artisteer template and I am trying to change my magazineJoomla layout a little so It resembles the theme of my template. So I went into the template CSS editor and changed this:

/* comment boxes */
#comment #Comments ul {
list-style-type: none;
list-style-position: outside;
list-style-image: none;
margin: 0px;
padding: 0px;
background: url( jbsecure.com/images/Journals/J-128-0010_paper_sample_500.jpg );
border-top: 1px solid #000000;

I wanted the entire background changed of my comment boxes but for some reason this CSS chnge is only occuring on every OTHER box. Not all of them. So I have the CSS change on one comment box and then my next comment box is plain white. How can I make it so that every comment box reflects the CSS background change?

Changing the background of comment boxes 12 years 11 months ago #12062

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Here is a pic:

Changing the background of comment boxes 12 years 11 months ago #12064

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
give me a link to your website and I'll tell you what else you need to change.
Daniel

Changing the background of comment boxes 12 years 11 months ago #12065

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
This is very weird. Last night, I refreshed the page at some point, and the background of the comment box switched to what I was trying to accomplish, All yellow comment boxes. And it has stayed that way. This might sound odd, but NOW I'd like to know how to go back to what was in the original pic, the alternating colors of the comment boxes, yellow, white, yellow, white. The co-owner of the sight (wife, lol) thinks she prefers it like that.

Here is the link:

www.njteachertalk.com/index.php?option=c...ing-is-among-options

Changing the background of comment boxes 12 years 11 months ago #12068

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
the magazineJoomla template had some js that was doing this effect. So did you delete the javascript for it?

Changing the background of comment boxes 12 years 11 months ago #12069

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Have no idea. I am a noob. Possible. Don't remember to be honest. Head spinning right now. So the way it is now, the comment boxes, they will stay all yellow? Any way to alternate the boxes back to yellow and white?

Changing the background of comment boxes 12 years 11 months ago #12072

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
look at the original magazine template - it should have a js folder in it with a js file that has few lines of code.

So you should have this folder in your template as well
Also -Include javascript library: option in layout should be on.

And in your template html file you should have this lines:
	{library}
			<script type="text/javascript" src="components/com_comment/joscomment/templates/magazineJoomla/js/custom.js"></script>
			{/library}

components/com_comment/joscomment/templates/magazineJoomla/js/custom.js - is the path to your js library - so make sure that it is the right one :)

Changing the background of comment boxes 12 years 11 months ago #12073

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Javascript is on. I have the right code and the right path. Not sure how this relates to my question though. Please pardon my ignorance. I just want to change the background of the comment boxes back to how I originally had it. alternating yellow and white instead of just all yellow. Can't this be rectified with a simple CSS change in the comment box background?

Changing the background of comment boxes 12 years 11 months ago #12077

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
It seems as if my problems are inter-related. The background of the comment box issue and the JS url website disabled issue. Because I just went and turned the post urls back on, allowing users to post their url and the background of the comment boxes changed back to the alternating yellow and white boxes.

www.njteachertalk.com/index.php?option=c...among-options#josc34

Changing the background of comment boxes 12 years 11 months ago #12078

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Now what happens is, that when I post a comment, the comment box is yellow. But once I refresh the page, the comment boxes resort back to being the alternating yellow and white

Ahhhhhhhhhhhh :rolleyes: , what gives?

Changing the background of comment boxes 12 years 11 months ago #12079

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Eric, well at the end you have to make a simple css change, but the problem is that due to the design of the comments - there is no odd class. And this is what the javascript is adding.

Open the custom.js file and change the first lines
window.addEvent('domready', function() {
	if($('tname').value == '' && !$('tname').disabled) {
		$('tname').value = 'enter your name...';
	}
	if($('temail').value == '' && !$('temail').disabled) {
		$('temail').value = 'enter your e-mail address...';
	}
	if(document.getElementById('twebsite').value == '') {
		document.getElementById('twebsite').value = 'enter your site URL...';
	}
 
	comments = $('Comments').getChildren();
 
	for(var i=1; i < comments.length; i++) {
		if(i % 2 ) {
			commentClass = comments[i].className
			comments[i].className = commentClass + ' odd'
		}
	}
});
to
window.addEvent('domready', function() {
if($('tname') != null) {
	if($('tname').value == '' && !$('tname').disabled) {
		$('tname').value = 'enter your name...';
	}
}
if($('temail') != null) {
	if($('temail').value == '' && !$('temail').disabled) {
		$('temail').value = 'enter your e-mail address...';
	}
}
if($('twebsite') != null) {
	if(document.getElementById('twebsite').value == '') {
		document.getElementById('twebsite').value = 'enter your site URL...';
	}
}
	var comments = $('Comments').getChildren();
 
	for(var i=1; i < comments.length; i++) {
		if(i % 2 ) {
			commentClass = comments[i].className
			comments[i].className = commentClass + ' odd'
		}
	}
});

now the comments will get an odd css class that you can style with a different background. And btw - the image for your comment background is not loading right now on your site.

Changing the background of comment boxes 12 years 11 months ago #12082

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
What does it look like? Possible to see a screenshot? Is it alternating the image with white? Like 1 comment box reflects the image, then the next comment box is all white?

That's actually what I would like as the end result.

So I made that edit. Now where do I locate that odd css class to change a different background. I am in the CSS file now

Changing the background of comment boxes 12 years 11 months ago #12083

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
line 436 #comment #Comments ul.odd { - you can style this element for the odd comments.
Daniel

Changing the background of comment boxes 12 years 11 months ago #12087

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Thank you, worked out great. Let me ask you something, when a user is not registered, and they're just a guest, the word {voting} appears next to the user name of every comment. Is there any way for this not to show up as {voting} when guests are viewing. I do not want to disable voting option for registered users, but I also would not like the word, {voting}, to appear in every comment box if that person is a guest or just not logged in.

Link:

www.njteachertalk.com/index.php?option=c...ing-is-among-options

Changing the background of comment boxes 12 years 11 months ago #12088

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
in index.html find
{voting}
to
{BLOCK-footer}
{voting}
{/BLOCK-footer}

The magazine template was actually not supposed to be in the package. It was made for magazine.joomla.org and was specific to their needs so that is why some of the options are hard coded.

Changing the background of comment boxes 12 years 11 months ago #12093

  • Eric Grohs
  • Eric Grohs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
Thanks, taken care of
  • Page:
  • 1
Time to create page: 0.157 seconds