Fork me on GitHub

pnRender module-centric stylesheets?  Bottom

Go to page 1 - 2 [+1]:

  • One thing I'm noticing about pnRender mods is that the template code can become cluttered with styles very easily. I don't see the solution. Is there a way to include the sheets for a module within the modules file structure?

    The only other thing I can see is asking end-users to add the style rules to their theme's sheet...but this seems rather counter-intuitive.

    I haven't actually tried it yet, but assumed I could use an include...would this be an acceptable method?
  • Ok, so a regular pnRender file include doesn't do the trick, nor did a regular HTML file include! ... but the @import method works:



    Of course, it's not putting the style tags in the of the page...but at least it works...
  • Thats one of the reasons I switched to using xanthia for themes. As long as you put

    Code

    <!--[modulestylesheet]-->

    above the tag in the theme templates, Xanthia will pick up the style.css in the pnstyle folder in the module.

    Doesn't help those who are using older version of PN but I think it's the way to go.
    I'm ready to be corrected if I'm wrong.
  • I understand your reasoning. I won't be switching to Xanthia though... The goal with pnRender is to make the output easy for end-users to customize (I think), but changing the mod code and theme method is more than I can swallow...lol... I'll just include the styles in the templates, mucky as it is...
  • If you are using PostNuke .760, you don't have to use a Xanthia theme (but I find using Smarty both for modules output and for themes tend to make me more productive) , for non Xanthia themes put the

    Code

    <!--[modulestylesheet]-->
    in the modules\Header_Footer\pntemplates\header_footer_page.htm template and it will work because this template is used for all non Xanthia themes !!
    Well I think that it is in fact already there so nothing to do just put your CSS file in your module's pnstyle directory

    --
    Visit my live reef aquarium.

    My Amazon wish list.
  • I put the between the tags of my AutoTheme main template... no joy.

    I tried the in my module template where it's to be used... no joy.

    The CSS file is located at ../modules/myMod/pnstyle/style.css...

    I think I didn't understand what you meant...
  • If your using AutoTheme, which doesn't work with 760, it looks like your stuck with doing it the way you are now or including the styles in your theme style sheets. Maybe when 760 final is here and Shawn gets the new AutoTheme out it will include all that stuff anyway.
  • Is there a way to loop through an array, populating a drop-down and including styles inline? Ie, the end-code would be as such:

    <select id="AlarContact_Switch" name="Subjects[Subjects]" size="1">
    <option value="default"></option>Default
    <option style="color:black" value="black"></option>Black
    <option style="color:blue" value="blue"></option>Blue
    <option style="color:brown" value="brown"></option>Brown
    <option style="color:cyan" value="cyan"></option>Cyan
    <option style="color:darkblue" value="darkblue"></option>Dark Blue
    <option style="color:darkred" value="darkred"></option>Dark Red
    <option style="color:green" value="green"></option>Green
    <option style="color:indigo" value="indigo"></option>Indigo
    <option style="color:olive" value="olive"></option>Olive
    <option style="color:orange" value="orange"></option>Orange
    <option style="color:red" value="red"></option>Red
    <option style="color:violet" value="violet"></option>Violet
    <option style="color:white" value="white"></option>White
    <option style="color:yellow" value="yellow"></option>Yellow
    </select>


    I've tried html_options, but couldn't figure a way to include the style. What I'm trying to do is have each option in the drop-down display in the respective color... I can do this with raw HTML, but that's kind of clunky...
  • Never done it but couldn't you create an AutoTheme command and use that?
    Shawn would be the better one to ask though.

    --
    Zikula Themes
  • I suppose...? With AT, you can specify a sheet for the module no problem, but this would have to be xcompatible with all the engines, being a module...

    I can live without the styling features I built into the pnHTML model which was _hacky_ to say the least... ;) ...but was hoping there'd be a built-in Smarty tag for dynamically styling a drop-down...

    Speaking of commands, I wrote a sweet little number to replace the Online block on a dev site. Reformats username and new/total PM statuts with inline styles...with a tiny graphical alert.



    ;)
  • Well you could check the engine and either call a Xanthia plugin or an AT command. :)

    --
    Zikula Themes
  • alarconcepts

    ...but was hoping there'd be a built-in Smarty tag for dynamically styling a drop-down...


    you could use the smarty cycle function or the html_options function... there may even be a way to combine them... not sure.
  • I tried it with html_options ... works great, except I can't use the colors...

    Haven't looked into cycling yet, thanks..
  • Quote

    for non Xanthia themes put the Code:

    in the modules\Header_Footer\pntemplates\header_footer_page.htm template


    Did you try that?

    is used in the core modules for alternate row colours. For a good example see modules/Blocks/pntemplates/blocks_admin_view.htm

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • Quote

    for non Xanthia themes put the Code:

    in the modules\Header_Footer\pntemplates\header_footer_page.htm template


    Line 3 makes no sense to me...

Go to page 1 - 2 [+1]:

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