zenpage improvement

hello

in the printNewsPageListWithNav function, the current item is not easily identifiable for the css

so, after each installation of a new version of zenphot, I do a hack in zenpage-template-functions.php to add a <span> on the current item

so could you implemente this feature in a next realase ?

line 1507-1508 of zenpage-template-functions.php
replace
`if($i == $current) {

echo "".$i."\n";

`

with
`if($i == $current) {

echo "".$i."\n";

`

Comments

  • Why would you add a `...` around the element? The

    `...`
    provides exactly the same wrapping and applies the class to the whole element.
  • vincent3569 Member, Translator
    Hello

    in fact, I tried to have the same CSS rules between printPageListWithNav() and printNewsPageListWithNav().
    but these two functions behave differently on the current element.

    with printPageListWithNav(), the current element is a navigable link, wheras with printNewsPageListWithNav(), the current element is not.

    after spending several hours to solve this CSS problem, add the span tag is the only way I found.

    if you have another solution, I know it well ;-)

    Otherwise, if you can change the core, it would be nice because it keeps me from making a hack with each new version, especially since I want to publish my theme.
  • acrylian Administrator, Developer
    You probably should improve your CSS knowledge...

    You can address the current element of the Zenpage pagelist with `.class-of-your-page list li.current { }`. Really not that hard and not that much extra. Of course if you have some global setting for uls you might have to add an `!important` to the call.

    Generally it does not make sense to link to the page itself you are currently on.
  • vincent3569 Member, Translator
    You probably should improve your CSS knowledge...

    You're absolutely right, I'm not expert in php and css and it's always very complicated to understand and modify the code php and css and I lose a lot of time on it
    Generally it does not make sense to link to the page itself you are currently on.

    you're right, but if you have a look, printPageListWithNav() generates the following html code for the current element:
    ` 1 </ a> </ li>`

    Finally, it should perhaps not modify printNewsPageListWithNav() but you need to simplify printPageListWithNav()

    what do you think about ?
  • acrylian Administrator, Developer
    Well, yes, the Zenphoto pagelist function is quite a little older than the Zenpage equivalent. We will think about that. Anyway, it should be easily solved now you know hte css...;-)

    Btw, regarding the "loosing time" on these stuff. That is normal and does not dissapear even when you know what you are doing. Especially the different browser behaviour fun...
  • vincent3569 Member, Translator
    after looking at the CSS rules to write, after asking for help on forums specializing in css, I gave up: I created two specific rules for two different pagination.

    but be sure that the simple addition of the tag <span> on the current element of printNewsPageListWithNav() would provide a more compact code css with one rule for both pagination.
  • acrylian Administrator, Developer
    You do know tht you can declare css class option for more than one at the time by doing something like `.class1, .class2 { ... }`?

    As said we will think about that but currently have a few more important things to do.
Sign In or Register to comment.