I have created a custom render in group_module.js
exactly as the example Rendering Entities with the exception of the line items['group/%'] = {
instead of items['team/%'] = {
. All other content nodes but group nodes (group/%
) show ok. Group nodes show no subscribe/unsubscribe button and no menu tabs mentioned below in the groups_menu_module.js
. I suppose that this module, groups_menu_module.js
, is not loaded somehow.
I have to mention that without the custom rendering of entity group and with 2 LOCAL_TASK_MENU menu tabs, everything works perfect.
groups_menu_module.js
function groups_menu_module_menu() {
try {
var items = {};
items['group/%']={
title: 'view',
page_callback: 'drupalgap_get_entity',
page_arguments: ['groups_menu_module_default_page', 'node', 1]
};
items['group/%/provoli'] = {
title: 'view',
type: 'MENU_DEFAULT_LOCAL_TASK'
};
items['group/%/melh'] = {
title: 'members',
type: 'MENU_LOCAL_TASK',
page_callback: 'groups_menu_module_melh_page',
page_arguments: [1],
title_callback: 'groups_menu_module_melh_page_title',
title_arguments: [1],
access_callback: 'groups_menu_module_page_access',
access_arguments: [1],
options: {
reloadPage: true
}
};
items['group/%/anarthseis'] = {
title: 'posts',
type: 'MENU_LOCAL_TASK',
page_callback: 'groups_menu_module_anarthseis_page',
page_arguments: [1],
access_callback: 'groups_menu_module_page_access',
access_arguments: [1],
options: {
reloadPage: true
}
};
return items;
}
catch (error) {
console.log('groups_menu_module_menu - ' + error);
}
}
function groups_menu_module_default_page(node) {
try {
var content = {};
content['title'] = { markup: node.title };
return content;
}
catch (error) {
console.log('groups_menu_module_default_page - ' + error);
}
}
I have to mention that all functions needed are present in the actual .js file, i just opted them out because i think they are irrelevant.
The pageshow
function of the other module is as the example in the above link:
group_module.js
function example_team_pageshow(nid) {
node_load(nid, {
success: function(node) {
var content = node.title; // Add other content here...
$('#' + example_team_container_id(nid)).html(content).trigger('create');
}
});
}
So to conclude the question is how to make the subscribe/unsubscribe button appear in the custom entity render? How to call og_ui_field_formatter_view() from my module to make the button appear?
I don't know if i made my self clear what is needed. If anyone need more information please ask so in the comments below to clarify some points.