[OJS 3] is it possible for theme to override plugin template?

Hello all,

I’m having difficulties handling URLs in the CSS files.
It’s being impossible to set background images easily.
So, I’m trying to use a CSS flags I found to add icons to the language toggle plugin.
I don’t want to create a new language toggle plugin. Instead, overriding the template should do the trick. Unfortunately, I can’t seem to figure out a possibility.
I’ve place the plugin template within the themesName/frontend/plugins as well as at templates/ level, but to no avail.

Any ideas?
If I could easily point to the image folder within the plugin, that’ll be awesome, but, somehow I can’t…

So, to summarize the problems:

  1. Unable to use background images, because I can’t load them (I don’t know how to use the @base-url is empty);

  2. Unable to override plugin templates. I don’t know if it’s possible and where to place the file if it can be done.

Hello all,

Finally got it to work.
If anyone wishes to customize their theme…

Set variables for each flag necessary in plugins/themes/ibict2020/styles/variables.less

@flag-en-us: ‘/plugins/themes/ibict2020/img/us_small.png’;
@flag-es-es: ‘/plugins/themes/ibict2020/img/es_small.png’;
@flag-pt-br: ‘/plugins/themes/ibict2020/img/br_small.png’;

Customized block_language in plugins/themes/ibict2020/styles/sidebar.less

.block_language {
li {
    a {
        padding-left:33px;
        background-size:26px auto;
        background-position:left center;
        background-repeat:no-repeat;
    }
}

li.locale_en_US {
    a {     
        background-image:url(@flag-en-us);
    }
}

li.locale_es_ES {
    a {     
        background-image:url(@flag-es-es);
    }
}

li.locale_pt_BR {
    a {     
        background-image:url(@flag-pt-br);
    }
}

}

1 Like