SMF Support > SMF 2.0.x Support

How to make main menu right justified in non-default themes?

(1/2) > >>

Vahid‎‎ ‎Damanafshan:
My forum is in Persian which is a right-to-left language. So my main menu (I mean Home, Help, Search ,...) should be right justified. Everything is fine with the SMF default theme, but when I install a new theme, it's main menu become right justified. Can anybody please tell me how to make this menu right justified?
By the way, I have the same problem with all new themes.

Antechinus:
The default theme comes with rt.css, but a lot of custom themers don't bother editing it for their custom code. Give them Hell. :D

Anyway, you can change some floats in index.css, or if you want to keep the option for using the theme with LTR languages you can do the edits in rtl.css. If the theme doesn't have rtl.css, you can copy the default one to the theme's css folder.

To know exactly what to change, I'd have to check out the theme's css and markup. However, the way to start is to look at the css code for the menu, and change anything that says float; left; to float: right;

I wrote a basic tutorial here: Making custom themes work with RTL languages.

Vahid‎‎ ‎Damanafshan:
I read the page you introduced, but unfortunately I couldn't solve my problem because the contents of the rtl.css and index.css you put there are different to mine.
I'm using this theme and the only problem is that the main menu is left justified. Can you explain how can I make it right justified. I've attached the rtl.css and index.css of this theme.  Please specify any changes you make.

Antechinus:
Ok, this should work. I added a note to rtl.css to show where the custom code for the theme starts (Line 1093).


--- Code: ---/* Begin custom code for Anecdota theme. */
--- End code ---

The rtl code for the logo, avatar, user area, search area and news is commented out. It will work if you remove the comment tags (/* and */) from each end of each code block. I left it commented out so you can use it if you decide you want to.

The code for the menu is functional and should work, although I haven't tested it live. See how it is, and let me know if there are any problems.

If you want to compare the changes to index.css, the corresponding code in that file starts on Line 3550.


--- Code: ---/* BANNER / LOGOS */
#logo a {
--- End code ---

Vahid‎‎ ‎Damanafshan:
Thank you so much. Everything is now fine, but two more things:
1- I couldn't move the logo to the right side of the forum.
2- Does this approach work for all themes which are on the themes page?

Navigation

[0] Message Index

[#] Next page

Go to full version