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?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnRender module-centric stylesheets?
-
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
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... -
- Rank: Developer
- Registered: Feb 23, 2005
- Last visit: May 09, 2010
- Posts: 399
Thats one of the reasons I switched to using xanthia for themes. As long as you putCode
<!--[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. -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
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... -
- Rank: Helper
- Registered: Jan 12, 2004
- Last visit: Jan 20, 2010
- Posts: 590
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 thein the modules\Header_Footer\pntemplates\header_footer_page.htm template and it will work because this template is used for all non Xanthia themes !!Code
<!--[modulestylesheet]-->
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. -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
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... -
- Rank: Developer
- Registered: Feb 23, 2005
- Last visit: May 09, 2010
- Posts: 399
-
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
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... -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
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 -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
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.
;) -
- Rank: Expert
- Registered: Mar 15, 2003
- Last visit: Oct 21, 2009
- Posts: 1221
Well you could check the engine and either call a Xanthia plugin or an AT command. :)
--
Zikula Themes -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
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. -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
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
- Moderated by:
- Support
