solved New module causes white screen

Developer Networks
Developer Networks
@developer-networks
8 years ago
566 posts
I have functionality that I have converted to a basic module so others can use. However when I did this it caused a white screen on the skin templates and hangs the integrity check on a jrSkin Im not sure why but it is a very basic module and I must have overlooked something easy.

you can call the function in the item list template:

Uploaded:{elapsed_time timestamp=$item._created}
zip
myBackTime.zip  •  139KB


updated by @developer-networks: 05/22/16 08:14:44PM
paul
@paul
8 years ago
4,326 posts
Is 'elapsed_time' a smarty function within your module? If not, then that could be the issue.
If its just a regular function that returns a value, call it like this - {$x = elapsed_time(Sitem['_created'])} then you can use $x in your template - {$x}
Note that 'elapsed_time' on its own as a module function name is not a good idea. It ought to be xxMyModule_elapsed_time so as to make it unique. If there are two elapsed_time functions you'll get a white screen, so maybe that is the issue?


--
Paul Asher - JR Developer and System Import Specialist
Developer Networks
Developer Networks
@developer-networks
8 years ago
566 posts
elapsed_time is a function called in the module.

It worked fine until I made it a module. I'll try the naming convention with the module.
paul
@paul
8 years ago
4,326 posts
Have just looked at your code. Call the function

"function smarty_function_myBackTime_elapsed_time($params, $smarty)"

Then call it from the template as

{myBackTime_elapsed_time timestamp=$item._created}

hth


--
Paul Asher - JR Developer and System Import Specialist
brian
@brian
8 years ago
10,148 posts
White Screen = PHP Error = check your PHP Error Log.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Developer Networks
Developer Networks
@developer-networks
8 years ago
566 posts
Thanks for the help guys, I got it Figured out :) You were right Paul When moving the functionality from the skin to a module I needed to rename the function as part of the new module.


Many Thanks!

Tags