Donna Torr
Donna Torr
Offline
0
Hi Guys,

Ideally I would like an additional tab in the Users admin area so I can add some instructions as to how to work with the affiliate scheme. Is there a simple way to do this?

Regards
Donna
Responses (2)
  • Accepted Answer

    Thursday, February 21 2019, 04:57 PM - #Permalink
    0
    hello

    it will require a bit of coding. we could somehow build a new tab that "loads" an article from your article manager and displays it in the affiliate dashboard
    The reply is currently minimized Show
  • Accepted Answer

    Donna Torr
    Donna Torr
    Offline
    Thursday, February 21 2019, 08:39 PM - #Permalink
    0
    Hi Germinal,

    Thank you for your response.

    I have managed to create a new tab by adding some modifications to the helpers.php file - obviously, if I update the component these will likely be lost.

    static function nav_tabs(){

    $params =JComponentHelper::getParams( 'com_affiliatetracker' );
    $itemid = $params->get('itemid');
    if($itemid != "") $itemid = "&Itemid=" . $itemid;

    $link_conversions = JRoute::_("index.php?option=com_affiliatetracker&view=conversions" . $itemid) ;
    $link_logs = JRoute::_("index.php?option=com_affiliatetracker&view=logs" . $itemid) ;
    $link_account = JRoute::_("index.php?option=com_affiliatetracker&view=accounts" . $itemid) ;
    $link_payments = JRoute::_("index.php?option=com_affiliatetracker&view=payments" . $itemid) ;
    $link_marketings = JRoute::_("index.php?option=com_affiliatetracker&view=marketings" . $itemid) ;
    $link_instructions = JRoute::_("index.php?option=com_content&view=article&id=9" . $itemid);

    $view = JRequest::getVar('view');

    $class_conversions = "" ;
    $class_logs = "" ;
    $class_account = "" ;
    $class_payments = "" ;
    $class_marketings = "";
    $class_instructions = "";

    switch($view){
    case "conversions":
    $class_conversions = "class='active'" ;
    break;
    case "logs":
    $class_logs = "class='active'" ;
    break;
    case "accounts":
    $class_account = "class='active'" ;
    break;
    case "payments":
    $class_payments = "class='active'" ;
    break;
    case "marketings":
    $class_marketings = "class='active'" ;
    break;
    case "instructions":
    $class_instructions = "class='active'" ;
    }

    $return = "<ul class='nav nav-tabs'>
    <li ".$class_conversions."><a href='".$link_conversions."'>". JText::_('CONVERSIONS') ."</a></li>
    <li ".$class_logs."><a href='".$link_logs."'>". JText::_('TRAFFIC_LOGS') ."</a></li>
    <li ".$class_account."><a href='".$link_account."'>". JText::_('MY_ACCOUNT') ."</a></li>
    <li ".$class_payments."><a href='".$link_payments."'>". JText::_('PAYMENTS') ."</a></li>
    <li ".$class_marketings."><a href='".$link_marketings."'>". JText::_('MARKETINGS') ."</a></li>
    <li ".$class_instructions."><a href='#' id='instructions'>". JText::_('Instructions') ."</a></li>
    </ul>";

    return $return ;

    }


    I initially added a link to an article but unfortunately, this did not load in the tab itself so it wasn't really ideal as it takes the user away from the affiliate interface. To try and keep the coding to a minimum, I have used Engagebox so that when a user clicks the 'Instructions' tab, I now get a popup displaying the information. I think this would be good for a future release however, as some explanation is needed if a user wants to advertise a specific page.

    Regards
    D
    The reply is currently minimized Show
Your Reply