Fork me on GitHub

Alter default news style (CSS classes)  Bottom

Go to page 1 - 2 [+1]:

  • Since I'm using CE I would like the body of the news to use PN-content-page-body and not PN-normal or PN-style.

    I tried to alter something under \HTML\modules\News but the location proved irrelevant.

    Where could I set this..?
  • I don't user CE, but assuming it uses an HTML file (it may not), then you can add a
  • autothemes

    I don't user CE, but assuming it uses an HTML file (it may not), then you can add a


    Maybe I wasn't clear about it...

    I just want the news to be displayed using CSS classes other that the default PN-normal and PN-sub. What file should I hack to achieve this?
  • I also don't use it, but whatever template it uses, whether it be the default themeindex (frontpage news summary) and themearticle (full news story) function in the main theme.php file, you can add the class to the existing tables. Even if they already have a class, you can apply more than one by space-separating them, so for instance:

    Code

    <table class="pn-normal pn-content-page-body"
    which applies the default PN style first (often it's not even set in the stylesheet), then the CE one override that where there's a conflict. This is very handy for adding styles that does specific things like float image left/right or apply an IE boxmodel fix to the overall layout class.

    Another thing, you can wrap a DIV around anything, like

    Code

    <DIV class="pn-content-page-body">...stuff...</DIV>

    To increase its precedence, you can be more specific in style rules:

    Code

    <TABLE.pn-content-page-body TD {}

    More specific rules always have precedence, and IDs more than classes. Sometimes that's why your carefully crafted rules are ignored, something else overrides it.
  • FORGET ABOUT CE!!!

    I JUST WANT TO DISPLAY THE NEWS (STORIES) NOT USING PN-SUB OR PN-NORMAL AS THEY ARE DISPLAYED BY DEFAULT, BUT USING OTHER CLASSES.

    In what part of PN is the content of news generated?
  • Have you tried deleting the PN-normal tags from the style.css sheet? Or deleting it altogether. Without the style sheets the theme will default to whatever font settings are contained in the HTML (at least for an AutoTheme - I assume the same is true for a regular theme).
  • autothemes

    Have you tried deleting the PN-normal tags from the style.css sheet? Or deleting it altogether. Without the style sheets the theme will default to whatever font settings are contained in the HTML


    I can't delete PN-normal from my insatllation... how will the other modules work?
  • Did you try searching the files in the NEws module for the use of those Classes and changing them?

    --
    Home Page | Find on Facebook | Follow on Twitter
  • mhalbrook

    Did you try searching the files in the NEws module for the use of those Classes and changing them?


    Yeap!

    If you visit ant story eg. http://server.com/modules.php?op=modload&name=News&file=article&sid=XXX the body of the story is enclosed in a <font class="pn-normal"> that has nothing to do with any HTML\modules\News\*PHP. To confirm that I changed all <font class="pn-normal"> inside HTML\modules\News\ to <font class="pn-cuckoo"> but the stories still keep displaying with <font class="pn-normal">.

    Where else could this <font class="pn-normal"> come from..?
  • Get an editor like Crimson Editor and search all the files for that class tag.
  • autothemes

    Get an editor like Crimson Editor and search all the files for that class tag.


    Ok, the class PN-normal appears almost 2,000 times inside the PN distribution… how will this help me?
  • Does it occur 2,000 times within a single file? I don't think so. Put on your Sherlock Holmes hat and do some sleuthing. Its obvious that no one here has an answer ready or, trust me, we'd give it to you. Maybe you can answer the question for some future reader. That is really what these forums are all about.
  • dsin

    FORGET ABOUT CE!!!

    I JUST WANT TO DISPLAY THE NEWS (STORIES) NOT USING PN-SUB OR PN-NORMAL AS THEY ARE DISPLAYED BY DEFAULT, BUT USING OTHER CLASSES.

    In what part of PN is the content of news generated?


    Re-read msandersen's post. It doesnt' have anything to do with CE and it tells you exactly what you need to do to modify the News.

    -Shawn

    --
    Get the Revolutionary AutoTheme HTML Theme System! Currently for Zikula, PHP-Nuke, CRE Loaded, osCommerce and Wordpress!
  • I'm with AbraCadaver on this, read that fella's previous post. PostNuke as it is now make poor use of Classes and IDs, all that will soon change, but in the interim the user interface on the whole is controlled through the theme.php file. Styling certain elements in individual modules can be tricky due to the few generic classes used. Deleting the PN-normal class?? Provided it doesn't interfere with everywhere ese it's used, As mentioned, if you don't define it in the user stylesheets, it doesn't do anything. You can modify the core if you REALLY want, but you shouldn't have to. Also, while still widely used, the FONT class is deprecated by the W3C, the preferred way is to either apply the class to the surrounding element or use SPAN or DIV, depending (SPAN for short bits of text, DIV for whole blocks).

    So, where are the News formatted, already?
    In the theme.php file, the section that controls the front-page news layout (summary) is the themeindex function, and the following function, the themearticle function controls the layout of the full story.
    this is where you're likely to find your errant Font tags.

    For the rest, re-read my previous post.
    Go forth and conquer those tags.

    Martin
  • msandersen


    Code

    <table class="pn-normal pn-content-page-body"
    which applies the defauklt PN style first (often it's not eve nset in the stylesheet), then the CE one override that where there's a conflict.


    Geez, I didn't know that - thanks :)

    Regards

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment

Go to page 1 - 2 [+1]:

  • 0 users

This list is based on users active over the last 60 minutes.