Articles not center align

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
RussHubs
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jan 22, 2009 3:15 pm

Articles not center align

Post by RussHubs » Sun Jan 25, 2009 10:37 pm

Hi guys, I have sorted this problem before, but cant figure it now...

I cant get the content of articles to center align when being viewed on the website.

I have changed the text align in the css template file.

Please someone that remembers, I have searched for the answer, just cant find it, have the boards deleted old posts ?

Thanks

User avatar
drmmr763
Joomla! Ace
Joomla! Ace
Posts: 1671
Joined: Tue Oct 23, 2007 8:51 pm
Location: Orlando, Florida
Contact:

Re: Articles not center align

Post by drmmr763 » Sun Jan 25, 2009 11:09 pm

Can you post a link to your site? I'll try to take a look. Also, have you tried just a simple

Code: Select all

<div align="center">text</div>
tag?
-Chad Windnagle
Please use the search feature as your question might already have been answered.

http://www.s-go.net/ ~ Website Hosting - Strategic Marketing - Website Development - Print Work

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Tue Jan 27, 2009 4:00 am

I am having a similar issue. I can't center align some of my content either. Also, the footers and other information in some of my extensions align to the left. For example, in Joomla Comment the credit at the bottom aligns left and in Fireboard the users avatar, name, rank etc is all aligned left. What do I do about that?
t3nacity

User avatar
drmmr763
Joomla! Ace
Joomla! Ace
Posts: 1671
Joined: Tue Oct 23, 2007 8:51 pm
Location: Orlando, Florida
Contact:

Re: Articles not center align

Post by drmmr763 » Tue Jan 27, 2009 4:25 am

Does the issue vary on each template or is it universal? I'm suspecting it's a templating issue rather than a Joomla! issue. Check the default template and see what your results are. Also you may have to add some code to the CSS divs to get things to work correctly.

Post links to your sites guys, I can't give you any advice unless I can see the issue and check out some code.
-Chad Windnagle
Please use the search feature as your question might already have been answered.

http://www.s-go.net/ ~ Website Hosting - Strategic Marketing - Website Development - Print Work

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Tue Jan 27, 2009 5:05 am

I am using the default template as this is the default template forum. My website is http://www.usfpaintball.com Thanks for the help!

I did some testing and it is something in the default template for sure.
t3nacity

User avatar
drmmr763
Joomla! Ace
Joomla! Ace
Posts: 1671
Joined: Tue Oct 23, 2007 8:51 pm
Location: Orlando, Florida
Contact:

Re: Articles not center align

Post by drmmr763 » Tue Jan 27, 2009 8:23 pm

I am having a similar issue. I can't center align some of my content either
Are you using the center tool in the editor to try to center content?
Also, the footers and other information in some of my extensions align to the left.
Yes this is related to the template. There is a line in the template.css file that left justifies everything:

line 182

Code: Select all

#whitebox div {
text-align:left;
However if you take that out / change it, I think that everything will be centered (that means everything - menues, content etc...) so that probably won't "fix" the problem.

I'm not sure if you actually have a problem, or you just want to change the way things were made. It seems to me that the template is functioning correctly, just not the way you prefer.
Fireboard the users avatar, name, rank etc is all aligned left. What do I do about that?
Fireboard has it's own templating system that isn't really related to Joomla!'s template. If you look at the css file and use FireBug, I think you can change some things by adding:

Code: Select all

#div_name_here {
text-align: center;
}
to your code.
-Chad Windnagle
Please use the search feature as your question might already have been answered.

http://www.s-go.net/ ~ Website Hosting - Strategic Marketing - Website Development - Print Work

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Tue Jan 27, 2009 10:27 pm

It is a problem actually, not just a preference. In a different template things that are supposed to be centered are.
t3nacity

User avatar
drmmr763
Joomla! Ace
Joomla! Ace
Posts: 1671
Joined: Tue Oct 23, 2007 8:51 pm
Location: Orlando, Florida
Contact:

Re: Articles not center align

Post by drmmr763 » Wed Jan 28, 2009 1:36 am

Yeah well templates will handle those things differently of course. Now, if you want to manually change things, you can simply create div classes and manual overrides for certain components. It's a simple enough task to go hack the tmpl files of your components to force different displays.
-Chad Windnagle
Please use the search feature as your question might already have been answered.

http://www.s-go.net/ ~ Website Hosting - Strategic Marketing - Website Development - Print Work

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Wed Jan 28, 2009 4:36 am

What would happen if I changed

Code: Select all

#whitebox div {
text-align:left;
To

Code: Select all

#whitebox div {
text-align:justify;
t3nacity

User avatar
drmmr763
Joomla! Ace
Joomla! Ace
Posts: 1671
Joined: Tue Oct 23, 2007 8:51 pm
Location: Orlando, Florida
Contact:

Re: Articles not center align

Post by drmmr763 » Wed Jan 28, 2009 4:50 am

I checked it in FireBug, it didn't seem to have any effect.
-Chad Windnagle
Please use the search feature as your question might already have been answered.

http://www.s-go.net/ ~ Website Hosting - Strategic Marketing - Website Development - Print Work

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Wed Jan 28, 2009 4:55 am

Is there anything I can do?
t3nacity

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Wed Jan 28, 2009 5:12 am

Chayan wrote:u can take help frm http://www.vinivcvd.com.
That's just some spam website. Hopefully a mod will see that.
t3nacity

User avatar
drmmr763
Joomla! Ace
Joomla! Ace
Posts: 1671
Joined: Tue Oct 23, 2007 8:51 pm
Location: Orlando, Florida
Contact:

Re: Articles not center align

Post by drmmr763 » Wed Jan 28, 2009 11:13 am

Well let's find something you want centered first of all. Say you want to center the credits on Joomla! Comment.

You'd go to (I'm guessing here cause I don't know the structure) <joomlaroot>/components/com_joomlacomment/views/comments/tmpl/

In that directory there should be a file named "default.php". Open it up and run down near the bottom you should see something that looks like a call to to the language file for the comments and probably a phpecho tag. (This is all pure guess btw, I haven't actually looked at the structure myself to see how it's set up).

Basically what you want to do is add a

Code: Select all

<div align="center/left/right/"> phpecho</div>
You can also add something like:

Code: Select all

<div id="your_id_here">phpecho</div>
And then in your template.css file add:

Code: Select all

.your_id_here {
text-align: center;
}
So there are some different wants of doing things to change how it looks. Basically the concept is to add div classes / id's to the areas you want more control over and then add CSS styles to them.

You can also do this stuff using the Template Overrides method:
http://docs.joomla.org/How_to_override_ ... omla!_core

which is the recommended method of J! 1.5.X now.
-Chad Windnagle
Please use the search feature as your question might already have been answered.

http://www.s-go.net/ ~ Website Hosting - Strategic Marketing - Website Development - Print Work

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Wed Jan 28, 2009 5:31 pm

This is a mess. I'll probably just switch templates.
t3nacity

RussHubs
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jan 22, 2009 3:15 pm

Re: Articles not center align

Post by RussHubs » Wed Feb 04, 2009 8:06 pm

ok sorry back to my original question...

Yeah url is HERE

I'm using the basic milkyway template, not added or change much to the standard setup.

I did have this installed awhile back and I fixed this problem then, so i think its a standard template problem, I have tried changing the white_div to center align but I dont want pill boxes to be center, just the articles...

I remember it was a case of adding some code, or changing somrthing, 1 line stuff...

any ideas would be helpful, yes i have tried using center align buttons and adding to html code of articles, still goes to left align

User avatar
t3nacity
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 22, 2007 3:48 am
Location: Tampa, Florida, US
Contact:

Re: Articles not center align

Post by t3nacity » Wed Feb 04, 2009 10:26 pm

Your stuff looks centered. How did you get it to work?
t3nacity

reelly1
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Feb 05, 2009 3:13 am

Re: Articles not center align

Post by reelly1 » Sat Feb 07, 2009 3:45 pm

Having same issues. Anybody resolve?
Thanks
Matt

SlamJoomBang
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Feb 10, 2009 6:16 pm

Re: Articles not center align

Post by SlamJoomBang » Tue Feb 10, 2009 6:30 pm

Similar: I am using the stock milkyway template and have the right side mods turned off, one column article, and this is not on the front page. Only one article on the page and it won't center properly unless I have a text line that is longer than the article width, long enough to require a wrap. With a paragraph of text the content in the article centers properly, without the paragraph the content in the article does not center (i.e. pics and stuff). The Footer is always centered. How do I make the article center without the long text string???

I am pretty sure the problem is in the template because everything centers properly in JA_Purity.

How do I fix the milkyway template?

dahatcheteer
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Feb 12, 2009 6:05 am

Re: Articles not center align

Post by dahatcheteer » Thu Feb 12, 2009 8:12 pm

This is the problem im having but i have a custom layout

exquisitezombie
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Feb 19, 2009 6:46 pm

Re: Articles not center align

Post by exquisitezombie » Thu Feb 19, 2009 7:08 pm

For the rhuk_milkyway template, add the following code:

margin-left:auto;
margin-right:auto;

to the "table.contentpaneopen, table.contentpane" tag in
templates/rhuk_milkyway/css/template.css

this makes sure there's equal margins on either side!

SlamJoomBang
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Feb 10, 2009 6:16 pm

Re: Articles not center align

Post by SlamJoomBang » Thu Feb 19, 2009 11:58 pm

Thank you exquisitezombie...... Works perfect!

sheffsss
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Sep 15, 2008 10:40 pm

Re: Articles not center align

Post by sheffsss » Sun May 10, 2009 12:23 pm

I am experiencing the same problem and noticed something in the code when viewing the html. I aligned a picture in the center and it works in both the editor and the browser. I aligned some text in the center and it works in the editor but not in the browser. vanilla milkyway template

The code for aligning the picture is: [div style="text-align: center"]

The code for aligning the text is: [<div align="center"]

1 - If I view the article's html and manually change the text alignment div to read the same as the picture alignment div, the text does get centered.

2 - If I place text inside the picture alignment div directly under the picture, the text is centered.

The margin-left:auto; margin-right:auto; code above did not work for me.

I'll keep plugging away and see if I can fix it. Hopefully my findings might trigger a light bulb for one of you in the mean time.


Sheff

sheffsss
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Sep 15, 2008 10:40 pm

Re: Articles not center align

Post by sheffsss » Sun May 10, 2009 12:31 pm

I just found something that worked for me to center text. I had to force it to use [p align="center"] instead of [div align="center"]

I did this by putting my cursor in front of the text I wanted to center and drop down the middle "format" menu in the editor and click paragraph. Then center the paragraph using the center tool.

A bit of a dodgy work around but, to the guy who's only tool is a hammer, the whole world looks like a nail.

For some reason, this command is not working --> [div align="center"]

Fixing that somehow would be the proper thing to do.

Sheff

Criosdaidh
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 27, 2009 5:03 am

Re: Articles not center align

Post by Criosdaidh » Tue Jul 28, 2009 11:36 pm

sheffsss wrote:I just found something that worked for me to center text. I had to force it to use [p align="center"] instead of [div align="center"]

I did this by putting my cursor in front of the text I wanted to center and drop down the middle "format" menu in the editor and click paragraph. Then center the paragraph using the center tool.

A bit of a dodgy work around but, to the guy who's only tool is a hammer, the whole world looks like a nail.

For some reason, this command is not working --> [div align="center"]

Fixing that somehow would be the proper thing to do.

Sheff

This worked for a charm for me. I just have to type everything and center it in paragraph, then go back and edit the different parts to what I originally wanted.

HarryMatter
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Fri Jul 17, 2009 6:28 pm

Re: Articles not center align

Post by HarryMatter » Tue Dec 29, 2009 12:23 pm

On a similar subject, can anyone tell me why, if you copy and paste from MS Word into an article, the text will wrap, but if you type directly into the article (in article edit) it does not wrap?

User avatar
drmmr763
Joomla! Ace
Joomla! Ace
Posts: 1671
Joined: Tue Oct 23, 2007 8:51 pm
Location: Orlando, Florida
Contact:

Re: Articles not center align

Post by drmmr763 » Tue Dec 29, 2009 2:15 pm

The text should always wrap. Also you should basically never paste from MS Word because Word creates a horrible mess of code that will screw up your articles.

If text isn't wrapping, ensure that you don't have any crazy code by viewing the article source. Also make sure you don't have any tables or images that are wider than the text area.
-Chad Windnagle
Please use the search feature as your question might already have been answered.

http://www.s-go.net/ ~ Website Hosting - Strategic Marketing - Website Development - Print Work

sheffsss
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Sep 15, 2008 10:40 pm

Re: Articles not center align

Post by sheffsss » Tue Dec 29, 2009 4:08 pm

I just tested this and it wraps no problem as long as I don't enter more than 185 characters without a space (1024x768 is my current resolution). If I enter more than 185 characters without a space before the 185th character it doesn't wrap. (Open a new test article and hold down one letter key until you hit about 200 characters, then scroll back and insert a space somewhere at around 100. It should wrap right away at that space).

As far as pasting from Word goes, it's probably pasting invisible carriage return characters that you can't see, so drmmr763 is correct when he says you better check the source to see what it translated those to in order to make it wrap. There may be some unwanted clutter in your code.

sheff

HarryMatter
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Fri Jul 17, 2009 6:28 pm

Re: Articles not center align

Post by HarryMatter » Tue Dec 29, 2009 4:29 pm

Thanks for the replies. I find the HTML editor seems to remove bits of code that aren't needed e.g. if I do a test with some nonsense code and hit update, it's gone next time I look at the code in the HTML editor. Will it still be there, causing problems, even though the HTML editor doesn't show it?

Also - using the 'loadmodule' plugin to display a menu within an article does the same thing: with the menu set to display in legacy horizontal mode, the menu items disappear off the right hand side (with no scroll bar). Any ideas?

I'm using the JA_purity template. Could that be the source of the problem perhaps?

All help very much appreciated.

babydoll926
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue May 25, 2010 4:35 pm

Re: Articles not center align

Post by babydoll926 » Fri Aug 27, 2010 1:40 am

I'm using the siteground-j15-14 template -- this solution worked perfectly for me! Thank you!!!
~Erica
exquisitezombie wrote:For the rhuk_milkyway template, add the following code:

margin-left:auto;
margin-right:auto;

to the "table.contentpaneopen, table.contentpane" tag in
templates/rhuk_milkyway/css/template.css

this makes sure there's equal margins on either side!
Please read forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?t=65

spider58
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Jan 05, 2008 10:16 pm

Re: Articles not center align

Post by spider58 » Wed Sep 08, 2010 7:42 pm

exquisitezombie wrote:For the rhuk_milkyway template, add the following code:

margin-left:auto;
margin-right:auto;

to the "table.contentpaneopen, table.contentpane" tag in
templates/rhuk_milkyway/css/template.css

this makes sure there's equal margins on either side!
oh man. thank you very much. that works perfectly.

But i don't know what can i do when im changed my template with other one :)


Locked

Return to “Templates for Joomla! 1.5”