Menu

Multiple text color support for custom themes

Anonymous
2009-06-26
2013-05-30
  • Anonymous

    Anonymous - 2009-06-26

    Greetings,

    I believe that PGV only supports two color options; either red or the single color for normal text.  This work well for the standard themes that have text on light background colors (e.g. Cloudy) or white text for dark background (e.g Simply Green). 

    However, the Colors' theme has text on both dark and light background colors.  As such, there is the need to have more than one  (non-red) text color e.g.  a dark color or a white color.  For the most part, this can be done via the .css files – except in one situation. 

    On the individual and family pages, there is a total at the bottom of the page that is controlled by functions_print_lists.php.   The style in this php file is "list_label name2".    Now, I have not found a way to set the font color for this text box without disrupting other displays. 

    So, my only option [that I am aware of] is to change php code which I do not want to do since the  Colors theme is widely used.

    What I would like is for PGV to be able to tolerate multiple text colors via style sheets.  However, in the short term, changing the functions_print_lists.php code to "list_label name3" would work.

    Rob

     
    • Veit

      Veit - 2009-06-26

      Hi Rob,
      normally todays css delivers a lot of options for selectors. I think it's no good idea to add additional classes for this purpose.

      I didn't found the code you mentioned in my generated output of individual.php. Perhaps you can explain the part of code more in detail. You should check also if your problem can be solved in a combined selector of id class and element combination.

      If this isn't the case we should first check, if it makes sense to add an additional id on structural elements before thinking about adding classes.

      Veit

       
    • Anonymous

      Anonymous - 2009-06-26

      Hi Veit,

      Line 1382 of functions_print_lists.php has this code:

          //-- table footer

          $html.='<tr class="sortbottom"><td class="list_item">&nbsp;</td>';

          $html.='<td class="list_item">&nbsp;</td>';

          $html.='<td style="display:none;">&nbsp;</td>'; // hidden column for sorting surnames

          $html.='<td class="list_label name2">'.$pgv_lang['total_indis'].': '.count($unique_indi);
      <-------------------------------------
          $html.='<br/>'.$pgv_lang['total_names'].': '.count($unique_surn).'</td></tr></table>';

          return $html;

      If I change name2 to name3 (with no selector defined for name3) then all is well.

      The generated code is

      <td class="list_label name2">Total individuals: 19<br/>Total Names: 4</td></tr></table><!-- begin footer -->        <script type="text/javascript" language="javascript" >
      <!--

       
    • Anonymous

      Anonymous - 2009-06-26

      Actually, I think I have a better answer, let me explain.

      Line 1382 of functions_print_lists.php (4.2.1) has this code

      $html.='<td class="list_label name2">'.$pgv_lang['total_indis'].': '.count($unique_indi);

      What is the purpose of referencing the name2 class?

      In the standard .css templates (standard, cloudy, etc) .list_label and .name2 both have
      color and font defined.  The code from the standard template is listed below.  So, why not just drop the name2 from the code?  When I did this to the above .php script then I was able to set the text color correctly.

      .list_label, .list_label_wrap {
          color: #333333;
          background-color: #b5c0df;
          font: bold 12px tahoma, arial, helvetica, sans-serif;
          text-align: center;
      }

      .name2 {
          color: #333333;
          font: bold 12px tahoma, arial, helvetica, sans-serif;
      }

      Rob

       
    • Veit

      Veit - 2009-06-26

      Rob,
      why are you not using a combined class selector?

      .list_label.name2 {
         all what you want
      }

      Veit

       
    • Anonymous

      Anonymous - 2009-06-27

      Veit,

      In several situations this is exacty what I did.  However, PGV generates this specific class statement as class="list_label name2"  and I have tried many different combination's but can not uniquely identify that specific item for my style.  The scope of everything I try  is too large and affect other displays.  So, unless I am missing something [qute possible since I am a novice at .css], the only workaround that works is to modify the one statement in the PGV .php code.  And, this is something that I can not do for a distributed theme such as Colors'.

      Rob

       
    • Anonymous

      Anonymous - 2009-06-27

      I think, as far as I can see, that name2 was added at some time to allow some themes (notably xenea) to have a unique color on hover (there is a 'a:hover .name2' tag as well) for certain locations. That may not have been the best solution.

      Viet, what Rob is proposing, is almost certainly appropriate in this case, and I suspect there are a great many more examples we could find. Is there any reason not to add another class? Basically Rob has the answer, but not the ability to make the change. He could (as I often do) change his own code, but that won't work in this case because he is working on a theme that many other people have also chosen to use (from www.pgvthemes.com).

       
    • Stew Stronski

      Stew Stronski - 2009-07-03

      Personally I'd like to see all page layout and styling removed from the base code and put into the themes. It would probably simplify things considerably for devs as well as theme builders. Can't say for sure but I don't think PGV was originally written to support theming at all.

      But until that happens I'd rather see the themes made to work with existing limitations instead of adding yet another class to the already bloated css to accommodate one theme. Though I suppose one more class won't make a huge difference either.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.