OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
OS Responsive Image Gallery module Support
Go to bottom Favoured: 0
TOPIC: Template Override not working
#34478
Volkward (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Template Override not working 2 Months, 2 Weeks ago Karma: 0  
Hello there,

Joomla allows to override templates of components within the template section in the backend. This way, changes made to the components' template won't be overwritten by updates of the component.
I tried to establish an override for the OS Responsive Image Gallery because I need a small change in the layout, but the Image Gallery won't accept the override. It's still using the original default.php file in components/com_osgallery/views/masonry/tmp instead of the default.php file in templates/mytemplate/html/com_osgallery/masonry folder.

So my question is: Do you actively block template overrides in some way or must this be some kind of bug or misbehaviour on my side?

Thanks a lot and best regards
Volker
 
Logged Logged  
  The administrator has disabled public write access.
#34504
admin (Admin)
Admin
Posts: 5355
graph
User Offline Click here to see the profile of this user
Re:Template Override not working 2 Months, 2 Weeks ago Karma: 66  
Dear Volker

Please in file {your site}//components/com_osgallery/helpers/osGalleryHelperSite.php

find function:
Code:

    protected static function findView($type, $view='default'){


and replace it to:

Code:

protected static function findView($type, $view='default'){
        $template = JFactory::getApplication()->getTemplate();
        $defaultLayout = $view;
        if (strpos($view, ':') !== false) {
            // Get the template and file name from the string
            $temp = explode(':', $view);
            $template = ($temp[0] == '_') ? $template : $temp[0];
            $view = $temp[1];
            $defaultLayout = ($temp[1]) ? $temp[1] : 'default';
        }
        // Build the template and base path for the view
        $tPath = JPATH_THEMES . '/' . $template . '/html/com_osgallery/' . 
            $type . '/' . $view . '.php';
        $cPath = JPATH_BASE . '/components/com_osgallery/views/' . $type . '/tmpl/' . 
            $view . '.php';
        $dPath = JPATH_BASE . '/components/com_osgallery/views/' . $type . '/tmpl/default.php';
        // If the template has a view override use it
        if (file_exists($tPath)) {
            return $tPath;
        } else if (file_exists($cPath)) {
            return $cPath;
        } else if (file_exists($dPath)) {
            return $dPath;
        } else {
            echo "Bad view path, please write to admin";
            exit;
        }
    }



Please backup this file first

Regards
Andrew
OrdaSoft team
 
Logged Logged  
  The administrator has disabled public write access.
#34656
Volkward (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:Template Override not working 2 Months, 1 Week ago Karma: 0  
Thanks a lot Andrew. Works like a charm

Best regards
Volker
 
Logged Logged  
  The administrator has disabled public write access.
#34669
admin (Admin)
Admin
Posts: 5355
graph
User Offline Click here to see the profile of this user
Re:Template Override not working 2 Months, 1 Week ago Karma: 66  
Your are welcome.

We will be happy if you can help us too and put excellent review and 100 hits
on Joomla.org for our Responsive gallery
extensions.joomla.org/extension/os-responsive-image-gallery

If you would like any further information or need some customisation service,
please do not hesitate to contact us too.

Best Regards,
Andrew
OrdaSoft team
 
Logged Logged  
  The administrator has disabled public write access.
Go to top
What are you looking for?
Anti-spam question: How many eyes has a typical person?