Center Admin Buttons Center Admin Buttons
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Center Admin Buttons

Started by justmickie, May 11, 2018, 01:30:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

justmickie

Hi, I am developing a theme and have hit an issue

I am attempting to center the admin menu and have not figured out as yet how.
My first attachment is what I have, the second is a photoshoped image of what I want

I have looked at the css code of everything marked .admin_menu
I tried to remove .admin_float and got what is pictured in the 3rd image
So then I tried to replace the values of float with display flex values ranter than display block in an attempt to have more control and it didn't affect it.
I can't figure out what I am missing?

ron4mac

A link to your site with the theme will get you much more help.

justmickie

Here is the link : http://coppermine.geekgirl-chic.com/index.php

Since it is the admin panel I didn't think a link would help, since you can't see it from the link
So I included the attached screen grabs in the first post
And I am being paid to create the theme, so I can't upload a copy

Centering the sys & sub menus was easy, its just the admin buttons
I can't figure out why its so dependent on the float css to stay normal sized
or why i can't control the divs with display: flex rather than display: block
I just want to get them centered. With the new format in 1.6 making the rows and grouping the buttons is super easy
If I can just get a handle on centering the groups I will be a super happy camper

Thanks for any help you can offer

ron4mac

If it makes any difference ... the link you provided points to a CPG 1.5.46 gallery.

ron4mac


For .admin_float :
get rid of float:left
set display:inline-block

For .admin_menu_wrapper :
set text-align:center

justmickie

My apologies. I built the theme on 1.5 first then moved it to 1.6
at a different url to make sure the theme would not break once she upgraded.
So I grabbed the incorrect link.

My issue though, was occurring in both 1.5 & 1.6 though, so it really doesn't matter.



well I feel stupid.
I had tried that one point and I have either saved it wrong, or forgot to remove the float value after changing it to inline-block.
because just changing it to inline and removing the float worked and centered the admin buttons.
I suppose this is what I get for coding at 3 in the morning.

I do have one last question though...
No where in my style.css do I have a line called .admin_menu_wrapper
Nor can I find it in the file titled coppermine.css
Where is it located?

Otherwise my issue is solved.
Thank you

justmickie

Well, it is fixed for 1.6 but not 1.5
When it first loads, it looks centered but when I hit the home button, all the admin buttons shove back over to the left
but only in 1.5 so I am guessing it has something to do with the admin wrapper that I can't locate?

justmickie

ok, I spoke too soon.
It is half fixed, inline will let me center in 1.6 but it puts huge gaps between every thing
If I edit out comments and spaces I get a template error
And when i try to display flex, i am still getting a column no matter what flex code modifiers  I use
My ultimate goal for this theme is to have it written entirely in css and flex
Which i have nearly done except for how the admin menu is not responding


Attached images :
Inline gaps (Admin 4)
Display flex (Admin 5)

I can PM you and admin password if that will help?

ron4mac

PM me links to both sites and admin credentials for both ... and I'll help you sort it out.

justmickie

I finally figured it out.
I still have no idea where the css for the admin menu wrapper is but it is not affecting the layout in any way that I can see

I managed to get flex working to control the menu thanks to your help in clearing out the float code.
My mistake was in not using enough containers to group the menu items
Once I layered in enough of those to break it into the groups I needed it worked like a charm.
Thank you so much for helping me with this I really appreciate it!

I have the theme fully css, responsive down to mobile except for a few items
Which I will sort out after copious amounts of sleep
I attached a final screen shot so you could see the new menu
though i am likely to reorder the buttons before i deliver it

Can't thank you enough

ron4mac

Unless overridden, the admin_menu_wrapper class is generated by the CPG code. All you have to do is add an entry for .admin_menu_wrapper with the attributes you want to your CSS.

justmickie

That is why i couldn't find it then!
Thank you.