// Set up our page
jmHtmlBegin('the module name');
jmBodyBegin();
//draw the heading title on the page
jmSpanCell("{$config['system_name']} module name", "module explaniation", 30, 'html_select_modify.png');
print '<link rel="stylesheet" type="text/css" href="module/module_name/css/style.css">';
i want to get the style sheet link into the <head></head> section.
is there a way to do that? since the head section is usually governed by the template in the skins or themes.
Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble
Posted: 01/15/09 00:26
There is also the output filter and block.head way, which Brian coded into 3.3.8, but I have jsut tried it on 4.0 and no luck. Are the output filters still working in 4?
bigguy:
I've just uploaded an updated 3.3.8 testing changed files package that adds support for pre, post and output smarty filters. How it works is that you place your defined filters into a "filter" file that is named the same as the template - i.e.
Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA
Posted: 01/16/09 14:56
This should be working - I just checked the code out and it all looks correct - are you seeing any errors or does it just not appear to work? Double check that you're not seeing a cached page.
Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble
Posted: 01/16/09 15:52
This really does work perfectly with the Module setup.
Note that the example above needs to be used like this:
Code
{jr_head} code to appear before </head> tag{/jr_head}
However, you are not limited to inserting things into the head right before the head tag, you can duplicate the plugin as uj_generator and have it appear before the generator tag, or change the regex a little more and insert keywords into keywords tag. All in all a very useful way of inserting your module code into Jamroom's in a not-very-intrusive way.
I guess your module will need to have the functions and filters uploaded to the include directory, but I haven't tried this yet so perhaps it will work in the smarty directory of the module, I am not certain.
_________________ Kulshi Mezian!
"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"
I haven't yet come across the way to use smarty templates for layout in my module building exercises yet.
Is that how were supposed to do it? I've just been using php to construct the layout mixing all that logic and layout together in a big spaghetti ball.
It would be nice to do separate it, but i haven't got to that page in the manual yet.
Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble
Posted: 01/17/09 03:00
The process function at the bottom of the jrYouTube.php file in the module's ranking directory shows how to use jrHtmlTemplate for ranking output using a template.
I have been using this just to call a single (non-ranking) template into a smarty function as well. You can add anything to the $_rep array and it will be available as a smarty variable in the template.
_________________ Kulshi Mezian!
"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"