seriously customized sidebar
-
I had another post earlier today, and this has a bit to do with that one – except circumstances have changed. Iwasn’t sure if it owuld be better to start a whole new thread (they have changed that much) or reply to the other one – so I flipped a coin and “new thread” won.
So, here’s the situation: I have a *seriously* customized sidebar. The way things are going, it’s getting out of control – my sidebar file is immense. There has to be a better way of doing this.
I’m using WordPress as a CMS. There are many *many* pages and subpages. Last count was around 50 Pages (this count is including the subs – there’s about 7 parents). Now, the client has requested that all of the links be *images* not text. Okay, I’ve gotten around that – I’ve just been placing images in the titles of the Pages, rather than text. However, because of the serious customization going on, I’ve had to abandon the use of the get_pages() list to call in the sidebar links, and instead, I’ve had to hand-code each link. This is getting to be a real PITA. And if the client ever adds a new page…agh. They’ll never figure out how to put the new link in.
The reason for the major customization is this (i’m going to list it, trying to be as clear as I can):
The list is a CSS-based hover list. When you mouseover the links, it’s like a javascript image swap – but it’s total CSS, no javascript needed. The thing I require for this to function – that the get_pages() list doesn’t give me – is that each link has its own ID. This is necessary for the links to work (the way it works is the background for the LI tag is the “on” state for the image. But the “off” state image is placed within the LI tag, hiding the background. Then you set a “display:none” in the stylesheet for the hover of the link, and it looks like an image swap, when in reality it’s just the image disappearing from view and exposing the background. Since each background image is different, each link has to have it’s own ID.)
Now the kicker is, I also have to have a current page and home page state for each link as well. So this sidebar coding is getting WAY out of control. I’ve been toying with ideas on how to get this to function, but I’m coming up blank – there *has* to be a better way to do this – one that simply allows the client to create a new Page, and the new link just shows up in the sidebar (or delete an old one and the link goes away).
If only they didn’t want so many hover states and images – argh! Would anyone have any ideas or suggestions on how to get this to work?
Or, alternatively, if I write a function to place in the wp_meta(), would that work? If I did that, could I save the function as a seperate file and call it in? What would I have to do to get that to work? (OMG, am I talking about writing my first plugin without even knowing it?!?)
I’d really appreciate any help you all could give. I gotta have this done by Monday morning (not that this is *your* problem, but it’s such a headache!)
The topic ‘seriously customized sidebar’ is closed to new replies.