solved Modifying create button url

SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
In my module I need to add a parameter to the url jrCore_item_index_buttons create button.

So I try to "overwrite" the create button by registering the button like this:
    $_tmp = array(
        'title'  => 'create',
        'icon'   => 'plus',
        'active' => 'on',
        'group'  => 'owner'
    );
    jrCore_register_module_feature('jrCore', 'item_index_button', 'myModule', 'myModule_item_create_button', $_tmp);

And I have the myModule_item_create_button function, so the button appears in the page, BUT it appears in addition to the original create button, not instead of.

Is there any way to add to the create button url?

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: 04/13/15 06:58:28AM
brian
@brian
10 years ago
10,149 posts
So just to be sure - you want to customize the "action" URL JUST for the "create" button in a jrCore_item_index_buttons smarty function call?

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Yes, I need to pass the category of the current item into the new item.


--
¯\_(ツ)_/¯ 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 :)
brian
@brian
10 years ago
10,149 posts
Right now this is not going to work - each of the create/update/delete buttons - on it's own - can accept an "action" parameter where you can custom define your own URL for the button. However, when called under the jrCore_item_index_buttons "wrapper", if you pass an action parameter in, it will be applied to all 3 of those buttons.

So what I need to do is add support for 3 new parameters:

create_action
update_action
delete_action

So they can be set individually if needed.

I will get that in for the next core release.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
OK, thank you Brian :)


--
¯\_(ツ)_/¯ 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 :)
brian
@brian
10 years ago
10,149 posts
Just an update that this was added in Jamroom Core 5.2.26 - you should be able to define the individual URLs now.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Thanks Brian, I'll try that out.


--
¯\_(ツ)_/¯ 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
10 years ago
2,584 posts
Works perfectly :)

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 :)
brian
@brian
10 years ago
10,149 posts
SteveX:
Works perfectly :)

Thanks

Glad to hear it Steve - thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags