Knowledgebase template overwrite

The standard output from any Joomla! Module or Component can be overridden by adding code to the html directory of your template. Using template overwrites is recommended because the changes you have made to the layout will not be affected by component updates. In this example we will edit the output of the Knowledgebase layout.

  • the first thing you need to do is go to templates/your_template_name/html and created a new folder named com_rsticketspro;
  • inside this folder you will need to create a second folder named knowledgebase;
  • you will then need to go to components/com_rsticketspro/views/knowledgebase/tmpl and copy the default.php file in your newly created knowledgebase folder.

You can now change the appearance of this view by editing the code of the default.php file from templates/your_template_name/html/com_rsticketspro/knowledgebase. For example:

 
    <style type="text/css">
    .xyz{
    color: #0B9DCC;
    font-family: comic sans ms;
    }
    </style>
 

Add the code above before:

 
    <script language="javascript" type="text/javascript">
 

...and replace the following code:

 
      <td align="right"><?php echo $this->pagination->getRowOffset($i); ?></td>
      <td>
      <a href="<?php echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=article&cid='.$item->id.':'
      .JFilterOutput::stringURLSafe($item->name)); ?>">
      <?php echo $item->name != '' ? $item->name : JText::_('RST_NO_TITLE'); ?></a>
      <?php echo $this->isHot($item->hits) ? '<em class="rst_hot">'.JText::_('RST_HOT').'</em>' : ''; ?>
      </td>
      <?php if ($this->params->get('show_hits', 0)) { ?>
      <td><?php echo $item->hits; ?></td>
      <?php } ?>
 

with:

 
      <td align="right"><?php echo $this->pagination->getRowOffset($i); ?></td>
      <td>
      <a href="<?php echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=article&cid='.$item->id.':'
      .JFilterOutput::stringURLSafe($item->name)); ?>">
      <?php echo $item->name != '' ? $item->name : JText::_('RST_NO_TITLE'); ?></a>
      <?php echo $this->isHot($item->hits) ? '<em class="rst_hot">'.JText::_('RST_HOT').'</em>' : ''; ?>
      <p class="xyz"><?php echo ' - ('.$this->escape($this->category->name).')'; ?></p>
      </td>
      <?php if ($this->params->get('show_hits', 0)) { ?>
      <td><?php echo $item->hits; ?></td>
      <?php } ?>
 

This will add the according category name under each article title. Style has also been added for the category name, as you can see in the following images:

Was this article helpful?

Yes No
Sorry about that

You Should Also Read

Extract some database values inside a custom field

Hiding the Priority field in the ticket submission form