ISSUE SUMMARY:
When a user is logged in and goes to her profile page, i would want to set the default plugin tab from Stream to a Profile plugin i have created. if you log into the jomsocial instance you will see my plugin, Challenge Tray. Please test on our development box.
STEPS TO REPLICATE:
1
2
3
4
5
RESULT
EXPECTED RESULT
BROWSER
HI, Sean.
Plugins in tab are loaded in loop and Theme Designer you could only set Stream or About me as default tabs. I suggest you to use jQuery plugin that will change classes thus you could set any tab s active.
Just look in Google, there are many examples of such scripts.
I took a look at several of the web examples for adjusting tabs but they dont seem to work with the joms-tab. It seems like the lack of using the UL tags is making it different than usual. I tried these variations to find the active tab but they all returned an object instead of the a number indicating the active tab item.
$( "jom-tabs" ).tabs( "option", "active" );
$( ".jom-tabs" ).tabs( "option", "active" );
$( ".joms-tabs" ).tabs( "option", "active" );
$( ".joms-middlezone" ).tabs( "option", "active" );
I think i can handle the rest if you can point me to the right selector for the tab.
Hi, Sean.
Tabs are <a> e.g:
<a href="#joms-app--29">“My Contacts”</a>
I think you misunderstood my question. I see that the tabs are in the A tags. I am trying to use the jquery tabs widget controls (
api.jqueryui.com/tabs/
).Is that not what is being used to implement your tabs?
i am able to make the actual tab <a> active by using
$('.joms-middlezone a[href="#joms-app--1"]').addClass('active');
however this doesnt, deselect the previous item (in this case, the stream tab) or make the actual content for my tab visible.
Hi, Sean.
So maybe I assign developer to this thread.
Hi Sean,
you can do it by using template override:
1. copy tabs.php from /components/com_community/templates/jomsocial/layouts/application/ to /templates/[your frontend template]/html/com_community/layouts/application/
2. edit it, change the code from
<div class="joms-tab__bar">
<?php
foreach ($apps as $app) {
//special case for active tab (about me and fix will follow the backend settings)
$active = true;
if($app->id == 'feeds-special'){
$config = CFactory::getConfig();
$active = ($config->get('default_profile_tab') == 0) ? true : false;
}elseif($app->id == 'aboutme-special'){
$config = CFactory::getConfig();
$active = ($config->get('default_profile_tab') == 1) ? true : false;
}
if (trim($app->data) != '') {
?>
<a<?php echo (!$active || $i++) ? '' : ' class="active"' ?>
href="#joms-app--<?php echo $app->id; ?>"><?php echo JText::_($app->title); ?></a>
<?php
}
}
?>
</div><div class="joms-tab__bar">
<?php
foreach ($apps as $app) {
if (trim($app->data) != '') {
?>
<a<?php echo ($app->id == "1") ? ' class="active"' : '' ?>
href="#joms-app--<?php echo $app->id; ?>"><?php echo JText::_($app->title); ?></a>
<?php
}
}
?>
</div><div id="joms-app--<?php echo $app->id ?>" class="joms-tab__content joms-tab__content--stream <?php if($app->core) echo " app-core"; ?>" <?php echo $first ? ' style="display:none"' : '' ?>><div id="joms-app--<?php echo $app->id ?>" class="joms-tab__content joms-tab__content--stream <?php if($app->core) echo " app-core"; ?>" <?php echo ($app->id != "1") ? ' style="display:none"' : '' ?>>