solved adding a module template

blindmime
@blindmime
10 years ago
772 posts
I'm trying to add a template in my custom module called pending.tpl. I have added this in profile.php:
function profile_view_agTask_pending($_profile,$_post,$_user,$_conf)
{ return jrCore_parse_template('pending.tpl',$_profile,'agTask'); }
I must be missing a step somewhere, because going to domain.com/profile/task/pending/ goes the the module index page. What am I missing?


updated by @blindmime: 05/02/15 12:54:43PM
michael
@michael
10 years ago
7,791 posts
That looks good to me @blindmine.

Try this:
function profile_view_agTask_pending($_profile,$_post,$_user,$_conf)         {
    return 'hello world';
}

then go to:
your-site.com/SOME USER/task/pending

It should spit out "HELLO WORLD".

If it doesn't then check your module is turned on and run the integrity check.

If it does, then put what you had back and check that you have a file at:
/modules/agTask/templates/pending.tpl

--edit--
If your still having no luck, add a default output too to check
function profile_view_agTask_default($_profile,$_post,$_user,$_conf)         {
    return 'THIS IS THE DEFAULT OUTPUT';
}

and also check that the location of these functions is in the file:
/modules/agTask/profile.php
updated by @michael: 04/01/15 01:08:14AM
blindmime
@blindmime
10 years ago
772 posts
Thanks, Michael. That helped me see I was technically doing it right. I do have another template called invoiced.tpl which works OK. When I added "pending" to profile.php I put the updated profile.php in the templates directory by mistake. It's working now.
michael
@michael
10 years ago
7,791 posts
Good stuff. :)

Tags