Support » Plugin: BP GTM System » [Plugin: BP GTM System] How do I change the order of Tasks and Projects in To Do view?

  • Hi,

    I am trying to reverse the order of Tasks and Projects in the To Do View for Groups. For one thing this matches the order in the To Do View on the user’s profile. For another, Tasks are going to be used much more often by the organisation I am setting up the website for, and I would like the tasks tab to load by default. This is the change I have made to bp-gtm-core.php:

    <?php if (bp_gtm_check_access('task_view')) { ?>
            <li<?php if ('tasks' == $current_tab || empty($current_tab)) : ?> class="current"<?php endif; ?>><a href="<?php echo $gtm_link ?>/tasks"><?php _e('Tasks', 'bp_gtm') ?></a></li>
        <?php } ?>
        <?php if (bp_gtm_check_access('project_view')) { ?>
            <li<?php if ('projects' == $current_tab) : ?> class="current"<?php endif; ?>><a href="<?php echo $gtm_link ?>/projects"><?php _e('Projects', 'bp_gtm') ?></a></li>
        <?php } ?>

    As you can see I have swapped the order of the code generating the list items, and moved || empty($current_tab) to the tasks list item.

    Whilst the order of the list items does change, the projects view, now the second item in the subnav menu, is active on page load, with the class “current” applied.

    From my perspective, it would be good if these list items could be reversed in a future update so that they match the profile view, but for now, could someone help me amend the core code so that the tasks tab is active on page load.



Viewing 1 replies (of 1 total)
  • After some experimentation I found that the setting I need to change, in addition to the above changes, was on line 7 of bp-gtm-system/templates/gtm/index.php:


    $bp->action_variables[0] = 'projects';


    $bp->action_variables[0] = 'tasks';

    Now the task view is always first in the list and active when no tab is actually specified in the URL (i.e. the URL generated when clicking on ‘ToDo’ in the top level navigation for each group: http://[site url]/groups/[group name]/gtm/).

    I still think it would be good if the plugin could be adapted to work this way as default, as this way the GTM tabs are in the same order as on the profile page, and, for me, the tasks view is used a lot more often than the projects view (which basically adds another layer of categorisation which is generally unnecessary for my implementation).

    Thanks for considering this!


Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: BP GTM System] How do I change the order of Tasks and Projects in To Do view?’ is closed to new replies.