How to Override View

  • Published by
    George Papadakis
  • Last modified
    28 October 2013
  • Up to date
    Yes
  • Profile concerned
    Webdesigner, Developer
  • Concerns
    Component Template
  • Since Version
    1.5.6
  • Voting
    Average rating
    10 votes
    • 1
    • 2
    • 3
    • 4
    • 5
  • Favourites
    198 How to Override View /documentation/tutorials-english/69-templating-module-plugin-content/198-how-to-override-view.html

-- Normally you must not change FLEXIcontent core files, for consistency reasons plus they are overwritten when you upgrade FLEXIcontent.
-- But you can use a joomla template override for customizing any template file of FLEXIcontent view.

The template files of all FLEXIcontent view are
components/com_flexicontent/views/...
/tmpl/default.php
components/com_flexicontent/views/.../tmpl/form.php
components/com_flexicontent/views/.../tmpl/special.php

e.g. the default template of view myview is
components/com_flexicontent/views/myview/tmpl/default.php

To create a customization override view of it

  1. copy above file to templates/mytemplate/html/com_flexicontent/myview/default.php 
  2. modify it, to suit your needs

Now you can upgrade to newer FLEXIcontent versions without losing your customizations

tags
view example:
components/com_flexicontent/views/tags/tmpl/default.php
copy to:
templates/mytemplate/html/com_flexicontent/tags/default.php 

search view example:
components/com_flexicontent/views/search/tmpl/default.php
components/com_flexicontent/views/search/tmpl/default_error.php
components/com_flexicontent/views/search/tmpl/default_form.php
components/com_flexicontent/views/search/tmpl/default_results.php
copy to:
templates/mytemplate/html/com_flexicontent/search/default.php
templates/mytemplate/html/com_flexicontent/search/default_error.php
templates/mytemplate/html/com_flexicontent/search/default_form.php
templates/mytemplate/html/com_flexicontent/search/default_results.php

TIP 1: You can -not- override the view file components/com_flexicontent/views/myview/view.html.php, but you can copy code from this file, to your joomla template override