Adding search function to cimi theme?

I just got finished modifying the cimi theme to match the rest of my site, and realized... there's no search box in cimi. Hmmm... How difficult is it for a non-developer to add a search box & functionality to a theme? Is there a bit of code I can cut from some other theme & paste into an appropriate place in the cimi .php file(s)? Or, is this more complex than I could handle that way?

Comments

  • Adding a search form to an existing theme should be easy using the `printSearchForm()` function. You can read more here: http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintSearchForm
  • Well, thanks for the reply, but I'd hardly call this "easy". I found the printSearchForm code in the Default index.php file, and inserted it in the Cimi index.php, but got an error. So, copied the search.php from the Default theme to Cimi. I did get some results, but the formatting is completely gone, and the navigation works nothing like the search in Default. The search.php file has 87 lines of code... of which I understand about 2%.

    It'd be nice (and surprising) if there was just some additional line of code that I need to tweak somewhere to get the search.php to recognize the Cimi theme, but I'm not holding my breath on that one.

    Any other advice? fwiw, my gallery is here:
    www.phlumf.com/gallery/
    There are very few photos in there now, but I have hundreds... I might be switching themes around back-and-forth, trying some things... so I can't guarantee what it'd look like at any given point. I've been using the search term "mushroom" for debugging...
  • There is additional lines of code you need to work on. As you said the formatting is completely gone on the search.php so you'll need to style it in your theme's css file. You can just copy the default search section, or style it from scratch, either one works as all the div classes & id's are labeled.
  • Did I mention I know _zero_ php?... I know some html... a little css, and that's about it.

    Ok, well, I found that key piece of code... it was near the top of the of the search.php - the "sylesheet" and "themeroot" stuff. I just copied that off another page, and that took care of like 85% of the job. Then I did a bunch of hunt-n-peck to figure out the rest. It seems I managed to get this working/looking OK, see:
    www.phlumf.com/gallery/
    Again, not much on the gallery at the moment, but I'm stoked about the format.

    One more thing: I'd like to get the forward back arrows on the image pages to not be stacked on top of each other. I can't figure out why there are line breaks between the elements. I'd like them to be next to each other, and centered above the image. I've tried a lot of experiments, but can't seem to get it working right. Hmm... Any tips would be helpful.

    One last thing: At what point has one modified a theme enough such that it becomes a new theme?

    Thanks for reading this & replying - I'm grateful. Maybe somebody can use the modified cimi with search when I'm all done?
  • acrylian Administrator, Developer
    Did I mention I know _zero_ php?... I know some html... a little css, and that's about it.
    Well, then I strongly suggest to learn at least the basics of PHP.

    To the black errors: You probably need to use `float` on their CSS statements.
    One last thing: At what point has one modified a theme enough such that it becomes a new theme?
    There are actually two parts of the theme, the design and the coding (especially if some special functions are involved). Generally a theme design is a new one if you can't really tell the origin.

    As to the modification, we surely can put that on our themes page (without official supporting as usual).
  • hey jley, I popped by your site earlier and left you a comment on the photos. Like acrylian said it's probably just a css/float issue. You may have them in the same div both floating right or left etc when they should be one of each. I took a gander at the CSS, try these:

    Change:
    #imgnav #prev { background-image: url(back.gif); background-position: center center; background-repeat: no-repeat; }
    #imgnav #forw{ background-image: url(forward.gif); background-position: center center; background-repeat: no-repeat; }

    To:
    #imgnav #prev { background-image: url(back.gif); background-position: center center; background-repeat: no-repeat; float: left; }
    #imgnav #forw{ background-image: url(forward.gif); background-position: center center; background-repeat: no-repeat; float: right; }

    Not sure if it'll work, but it's something to start with. If that doesn't work for some reason you'll want to play with the #imgnav css some. It could be stacking them because you have the #immgnav div width at 55px, but that seems like it should be plenty considering how small the images are...
  • Well... thanks again for the tips. I wasn't able to get the nav buttons all on the same line. I did manage to move it all to the left of the screen, which I guess I like a little better. Anyway, this isn't too big of a deal I guess. I do like the fact that they don't move as one clicks through images.

    I tried changing the 55px, but the nav buttons were still stacked on top of each other... just wider. Maybe I'll tackle this again sometime.

    I would like to learn things like php, but just don't have the time. And the trouble is that for what I really need to do, it's hard to justify spending the amount of time it'd take. It's just a dilemma, I guess.

    Thanks for visiting my gallery, but I didn't see any comments. Now I wonder if that's working correctly. I did do some test comments myself, and those seemed to work. I guess I'll try some other testing.

    Anyway, in the coming weeks, I'll be adding quite a bit to the gallery (hopefully). My goal is to combine this with a wordpress blog and just have a more dynamic site than what I have now at phlumf.com.
Sign In or Register to comment.