Allow for a jrLike tpl_dir parameter

SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Could jrLike work in the same way as jrComment regarding the tpl_dir and template parameters?

I'd like to specify a custom template parameters in my module template without having to create an override in the skin.

This is from jrComment:
if (isset($params['template']) && $params['template'] != '' && $params['tpl_dir']) {
    //allow other modules to set the tpl_dir.
}
elseif ...

It would be cool if jrLike and jrRating did the same.

Thanks :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 10/21/16 03:14:21AM
paul
@paul
8 years ago
4,332 posts
At the moment Like and Rating do this in the smarty processing -

    if (isset($params['template']{0})) {
        $params['tpl_dir'] = $_conf['jrCore_active_skin'];
    }
    else {
        $params['template'] = "{$params['type']}_rating_form.tpl";
        $params['tpl_dir']  = 'jrRating';
    }
So you're saying that you want to optionally specify alternative modules/skins for the location of the template?


--
Paul Asher - JR Developer and System Import Specialist
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Hi Paul :)

Yes, jrComment has the additional if for the tpl_dir parameter which allows template override by a module (ujCustom) where the tpl_dir=ujCustom


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 07/09/16 02:00:55PM
paul
@paul
8 years ago
4,332 posts
Ok - I'll look into adding that in.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Thanks Paul, I've temporarily added that in to both jrLike and jrRating here on localhost and I'm not seeing any problems with it.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
paul
@paul
8 years ago
4,332 posts
Cool - post your code and I'll check it out.


--
Paul Asher - JR Developer and System Import Specialist
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Already did - that's in the first post ;)

in jrRating change this:
if (isset($params['template']{0})) {
        $params['tpl_dir'] = $_conf['jrCore_active_skin'];
    }
    else {
        $params['template'] = "{$params['type']}_rating_form.tpl";
        $params['tpl_dir']  = 'jrRating';
    }
To this:
if (isset($params['template']) && $params['template'] != '' && $params['tpl_dir']) {
    //allow other modules to set the tpl_dir.
}
elseif (isset($params['template']{0})) {
        $params['tpl_dir'] = $_conf['jrCore_active_skin'];
    }
    else {
        $params['template'] = "{$params['type']}_rating_form.tpl";
        $params['tpl_dir']  = 'jrRating';
    }
Same in jrLike but with $params['tpl_dir'] = 'jrLike';


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Hey Paul, are you playing at the Folk House in Bristol this year?


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
paul
@paul
8 years ago
4,332 posts
Thanks Steve - will get those worked in.

That festival at the Folk House is not happening this year, so no, but will get down to Bristol again sometime soon. Will let you know when.


--
Paul Asher - JR Developer and System Import Specialist

Tags