Log in

View Full Version : Problems adding to User CP Nav


ChrisHasenpflug
08-08-2009, 09:44 PM
I'm trying to have my product add a link to the User CP navigation via template.

I have a plugin hooked to usercp_nav_start:
$cells[] = 'op_seatmap_editseats';

I call construct_usercp_nav('op_seatmap_editseats'); in my added page. It generates the navclass correctly if I print_r. However, because I'm pulling in the additional links before this code gets executed my td class is blank.

I have a plugin hooked to global_start which fetches the template:
eval('$template_hook[usercp_navbar_bottom] .= "' . fetch_template('op_seatmap_usercpnav') . '";');

I needed to do this so it would execute on all pages under the User Control panel, but again, because it construct_usercp_nav() hasn't been executed I'm getting a blank class. Where is the right place to call my fetch_template for the User CP Nav template?

--------------- Added 1249771721 at 1249771721 ---------------

Well, I'm an idiot. I hooked the template fetching to usercp_nav_complete and that seems to work.

omardealo
06-29-2016, 04:42 PM
ADD THIS CODE TO HOOK : user_nav_start

$navclass['op_seatmap_editseats'] = ($selectedcell == 'op_seatmap_editseats' ? 'alt1' : 'alt2');
eval('$template_hook[\'usercp_navbar_bottom\'] .= "' . fetch_template('op_seatmap_usercpnav') . '";');