I am trying to customize the HTML output for Flexicontent pages and categories.
My first attempt was to follow the standard Joomla way of overriding the component output. I created the file /templates/mytemplate/html/com_flexicontent/items/default.php and it didn't work (I tried with all views).
Then I used the Flexicontent templates function. I created a new template and modified item.php to make it super simple:
Code:
<?php if ($this->params->get('show_title', 1)) : ?>
<h1><?php echo $this->escape($this->item->title); ?></h1>
<?php endif; ?>
<?php foreach ($this->item->positions['Content'] as $field) { echo $field->display; } ?>
However there is still a lot of Flexicontent JS and CSS loaded on the page, as well as some inline <script>. I tried to "unload" the JS and CSS both in item.php and in my Joomla template's index.php by using:
Code:
$document =&JFactory::getDocument();
unset($document->_stylesheets['/components/com_flexicontent/assets/css/flexicontent.css']);
unset($document->_stylesheets[$this->baseurl . '/components/com_flexicontent/assets/css/fcvote.css']);
unset($document->_scripts[$this->baseurl . '/components/com_flexicontent/assets/js/fcvote.js']);
unset($document->_scripts[$this->baseurl . '/components/com_flexicontent/assets/js/fcfav.js']);
unset($document->_scripts['/media/system/js/tabs.j']);
unset($document->_scripts['/plugins/system/flexiaccess/flexiaccess.js']);
and the only one that would be removed is /plugins/system/flexiaccess/flexiaccess.js when using the code in index.php.
This is very frustrating because it seems that Flexicontent does not follows Joomla standards.
Do I need to hack Flexicontent component code to get this done? Or is there a clean way to achieve this?
By the way: please don't challenge my rationale for wanting to remove the JS and CSS. I know it is used for voting, sorting, etc. etc. but we don't use any of that in this site.
Thank you!