25
votes
Accepted
How to check what component is being used on current page?
For Joomla 3.x
While the code from the other answer will work, JRequest is deprecated, therefore you should use the following:
$jinput = JFactory::getApplication()->input;
echo $jinput->get('...
23
votes
Accepted
How do I override the CSS styles in my template?
Why use CSS overrides?
It's always a good idea to keep your CSS styles separate from the existing template styling, if you're using a pre-built Joomla template.
It's easier to maintain
Your changes ...
15
votes
Accepted
Adding custom CSS styling on some of my pages
There are several ways to add custom CSS code to a specific page. Here's a couple of alternatives:
Alt. 1 - Page class
Use page classes. In the menu item editor, under the "Page display" tab, there's ...
12
votes
Accepted
How to get the alias or title of the active menu item?
To get the data of the active (current) menu item, use the following code:
$app = JFactory::getApplication(); // Access the Application Object
$menu = $app->getMenu(); // Load the ...
10
votes
Accepted
How to display module in component area
I have done this by creating a module position at the same location with the component and checking if a module is present at this position then display it, otherwise go for the component:
Code ...
10
votes
How to display module in component area
To enhance the given answers here:
To include a modul position in your component view and to load modules there, you just have to add
echo JHtml::_('content.prepare', '{loadposition ...
9
votes
Accepted
Displaying a Form Field Depending on Previous Question
The feature which you require was introduced in Joomla 3.3.x. You now have the ability to use showon="show_label:1"
You can se the PR, which introduced the functionality here: https://github.com/...
9
votes
Accepted
Best way to override the index.php file from a joomla template
Yes, the best way is to copy the desired template by Joomla admin. Go to Extensions > Template Manager > Templates and click on desired template.
Then click on Copy Template and enter the new ...
9
votes
How to check what component is being used on current page?
For Joomla 2.5
We can check by getting the URL parameters, using the JRequest::getVar() method and check for the option parameter.
jimport( 'joomla.environment.request' );
echo JRequest::getVar('...
9
votes
Adding custom CSS styling on some of my pages
One of my favorite approaches is to create dynamic classes for the body element.
So:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive(...
9
votes
Accepted
How to customize the look of the admin ISIS template with CSS? ISIS custom.css
Custom.css for Joomla 3.4.1 and later
This method is the easier for custom CSS overrides for the admin template. Simply create a custom.css file and place it inside the css folder of the ISIS ...
9
votes
Accepted
How to permanently remove/disable default Joomla templates
You can't prevent Joomla from upgrading her core templates. They are in there for a reason as a part of default installation. I am afraid you will just have to learn how to live with them. I did the ...
8
votes
How do I override the CSS styles in my template?
Joomla 3.5+ (Protostar template)
As of Joomla 3.5, you're able to create file called user.css and place it in:
templates/protostar/css/user.css
Note: the file name must be user.css
The protostar ...
8
votes
Accepted
What is best approach to show the component page in popup-modal window without header and footer?
Haven't done this for awhile, but these steps should do it:
Add JHTML::_('behavior.modal'); near the top of the view
Add class="modal" to any links you want to open in a modal window
Add &tmpl=...
8
votes
Accepted
Developing Outside the CMS
In the index.php file of your folder, such as \joomlaroot\yourfolder\index.php, load just the framework of your Joomla site, use the following code:
Once that is done, you have full access to "...
8
votes
Accepted
Is it possible to load a newer jQuery version?
Or does Joomla really need the 1.x version?
Joomla itself may work mostly fine with newer jQuery versions. The reason it ships with such an old version is compatibility for 3rd party extensions.
So ...
7
votes
Accepted
Fatal error: Call to a member function get() on Templates Manager
Well, a quick look inside the templates folder of the site, presented me the ugly truth - it seems that whoever did the upgrade, has never considered to clean up the site from old code/extensions/...
7
votes
Is development of template from scratch really worthwhile?
In my opinion, it can depend on the complexity of the site.
For example, if a client wanted a fairly basic site with a custom design, I'd duplicate Protostar (default Joomla 3.x template). Then strip ...
6
votes
Accepted
creating new template in 3.3
The general rule when doing a template is to load your own CSS files after the <jdoc:include type="head" />. That's important because this way you have the final say over CSS rules.
However that ...
6
votes
Accepted
How to change Joomla! 3's bootstrap theme preserving original?
You don't overwrite core files. You never do. Just don't.
Put the CSS files into your template directory and load them from there.
Have a look at how the Protostar template does it. The CSS file is ...
6
votes
How to make shorthand for countModules?
There is simply no need to do this. As @Bakual has already said, your approach is bad practice.
For starters, you are wrapping a function within a function unnecessarily when it's not required. You ...
6
votes
Joomla constant to current template path
Look at https://gist.github.com/leFlea-snippets/4602845
PHP: Joomla - Get active template path
// Get active template path from anywhere on Joomla:
$app = JFactory::getApplication();
$path = ...
6
votes
Accepted
Update Server for template
I think the article is not up-to-date because update server is working properly with template.
Here's the code I use in the templateDetails.xml
<updateservers>
<server type="extension" ...
6
votes
Making an ajax-based template?
My advice to you - avoid this. It's a recipe for many problems. A website owner who wanted this ended up paying us a lot of money just to fix the problems that arose from using this strategy (there ...
6
votes
Accepted
Remove "Joomla! Hosting from cloudaccess.net" in CloudBase3 template
You can also modify the code directly by opening the file
../templates/cloudbase3/features/branding.php using your favorite php editor.
At lines 21-24 you will see this code :
<div class="rt-...
6
votes
Accepted
Different templates for viewing and editing articles
It's actually possible by overriding it via 3rd party plugin. You can create a simple system plugin calling setTemplate() method when the onAfterRoute event occurs :
public function onAfterRoute() {
...
5
votes
How do I override the CSS styles in my template?
Helix Framework (JoomShaper)
Another Joomla template framework, that facilitates the customization workflow.
Helix Framework templates provide as well an easy way to add your custom styles with 2 ...
5
votes
Accepted
Is there a way to have the article edit box stretch the full width of the screen in Joomla 2.5?
You can just add a view override in the template:
Understanding Output Overrides
http://docs.joomla.org/Understanding_Output_Overrides
Component Output Types and Layout Overrides
http://docs.joomla....
5
votes
Accepted
How to move print/email to be inline with article title for blog view?
The way you did change the view for your article layout is half the way the appropriate. That's because you did a good job finding and editing the correct php file (the template file for the article ...
5
votes
Accepted
Joomla 3 Protostar template disappeared
You can copy the template folder from the Joomla 3.4 full package.
Simply download the file, unzip everything (or only the templates\protostar\ folder) to your Joomla folder. Then use the discover ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
templates × 308joomla-3.x × 118
css × 39
module × 20
template-override × 20
php × 18
joomla-2.5 × 15
overrides × 14
development × 12
joomla-3.4 × 11
extensions × 11
component × 10
menu × 10
articles × 9
menu-item × 9
layout × 9
joomla-3.5 × 8
helix3 × 8
positions × 8
joomla-3.3.x × 7
t3-framework × 7
javascript × 6
administrator × 6
images × 6
template-framework × 6