21

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 will not be lost if you upgrade the template You can easily copy/move the modifications to another template or another site. How does CSS overrides work? CSS ...


21

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('option'); For example, if you are displaying an Article and use the above code, it will output com_content


17

Unless the author of the template made it a specific condition of downloading the template, you can remove any markup from the template, and that would include this-template-build-by-X links.


15

There isn't really a 'better way' than that. The only other option is to check whether you're on the homepage in your template file. To check if you're on the homepage you can use the method described on the docs here: http://docs.joomla.org/How_to_determine_if_the_user_is_viewing_the_front_page and do something like: <?php $menu = JFactory::...


14

By default you could use the following styles: none (output raw module content) html5 (chosen html5 tag and font headder tags) table (wraps the module in a table) horz (wraps the tabled module output in a tag of another table) xhtml (divs and font headder tags) rounded (allows for rounded corners by wrapping in nested div tags) outline (add preview ...


14

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 a field called "Page class". This will add a class to your <body> tag (or a <div class="YOURCLASS">...</div> around your content), depending ...


11

Upgrading a template should be as simple as using the Joomla installer to upload and install the updated version of the template. For it to work, though, the templateDetails.xml file must define the 'method' as 'upgrade', rather than 'install'. You can check this by unzipping the template install file, opening the templateDetails.xml file and check for the ...


10

Perhaps there is only one safe answer - only download direct from the original creator and preferably from a well known template house. Most of the commercial template devs do at least one free template. Do your research on the creator as much as the template ;)


10

Since you're looking for free templates I assume you're not looking to spend extra, but myjoomla.com has excellent security scanning. The details of what you're looking for: start with looking for any inserted iframes. Then look for any php files that are not the index.php or component.php, etc layout files..and if you see anything besides Joomla ...


10

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 JMenuSite Object $active = $menu->getActive(); // Load the Active Menu Item as an stdClass Object The $active is an object of the current menu item. ...


9

Clone the livesite with Akeeba, install it locally, then adjust as required. When you're finished SSH / FTP your changed files back to the live site. There are a whole host of good reasons why it's imprudent to “tweak” on a live site…


9

You've a few options here, depending on whether your focus is ease of use, automation or cost: Do exactly what you did before with your local install, but once installed, change the local Joomla installation to use your live, remote MySQL database in configuration.php, if your host supports remote access. Be careful though - any DB changes will roll over ...


9

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/joomla/joomla-cms/pull/3127


9

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 name. Then make it default and work on the index.php file. Side notes: The reason why your changes got overridden is because sicne the initial release of the ...


9

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('option', '') JRequest API Documentation


9

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 sample: <main id="content" role="main" class="main"> <?php if ($this->countModules('myposition')) { ?> <jdoc:include type="modules" ...


9

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 same, because they used to bug me before, but not anymore... But if you really want to move them out of your way, you can always Disable them in Extensions | ...


8

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 yourmodulposition}'); to the view file. The second string with the load position short tag can be replaced with a var which contains more html if you need that. You don't ...


8

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=component the the link you want in a popup Note: I answered, then deleted this because upon trying it with a J3.3 installation, I got some javascript errors, so ...


8

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(); $class = $active->alias . " pageid-" . $active->id; ?> <body class="<?php echo $class; ?>"> Some examples of what the above code ...


8

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 "everything Joomla". <?php if (!defined('_JEXEC')) { define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(dirname(__FILE__))); require_once ( JPATH_BASE ...


8

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 template, like so: administrator/templates/isis/css/custom.css The template will load this css file last, so any css rules declared there, will override the core ...


7

I tend to use commercial templates, and they provide a nice graphical map I can use as a guide. Other than that, you might want to mess with PowerAdmin by Joomlashine (It's not a template, it's an enhancement to the admin). It's got a nifty layout that lets you see the different positions and what modules are loaded in them.


7

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 template will check if: The file exists The file size is > 0. If both conditions are met, it will automatically import this file for you. See the Pull ...


7

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 out all the bits I didn't require, such as parameters etc, and then go on to the design. If the client required a fairly complex site, with a fair amount of ...


6

Joomla 3.x ships with the files for Bootstrap 2, and due to backward compatibility this is not likely to change in Joomla 3.x series. It's important to know that Bootstrap consists of two main areas: The CSS files The JavaScript framework CSS Joomla has those files included both as source LESS files and compiled CSS files. Joomla itself doesn't load any ...


6

If it's just CSS changes you are making you may as well continue previewing them in Chrome Development Tools and using an online development environment such as Cloud9 or ShiftEdit you can connect directly to your server via FTP and make tweaks to the live site using a proper IDE similar to how you did when it was hosted locally. I wouldn't however ...


6

All you need is a plugin. You can write a content plugin adding a onContentPrepare method: public function onContentPrepare($context, &$article, &$params, $page = 0) { $doc = JFactory::getDocument(); $doc->addScript("http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"); } or you ...


6

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 also means that you don't use $doc->addStyleSheet() in your template. Instead you just write it as plain HTML into your head after the jdoc statement. ...


6

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 located here: https://github.com/joomla/joomla-cms/tree/staging/templates/protostar/css and loaded with this call: $doc->addStyleSheet('templates/' . $this-&...


Only top voted, non community-wiki answers of a minimum length are eligible