Hot answers tagged

8

Most of the time JHtml::_("script", "path/to/script.js"); JHtml::_("stylesheet", "path/to/stylesheet.css"); JHtml::_("jquery.framework"); will call JHtml::Script("path/to/script.js"); JHtml::Stylesheet("path/to/stylesheet.css"); JHtmlJquery::framework(); However there is a small difference between the two calls. The first one allows system plugins to ...


7

To load CSS and Javascript files, you want to use JUri::base() instead of JPATH_COMPONENT_ADMINISTRATOR. Also have a look at a more advanced loading mechanism, JHtml. Adding JavaScript and CSS to the page


7

JHtml is normally used in extensions as it's means overrides can be performed which is a really good feature if you're a developer. It also extends $document->... by adding some additional functionality. Here is an example: /js /script.js /script.min.js When using JHtml, the minified version of the script will be loaded to reduce page loading ...


6

In Addition to the others, the single biggest benefit I have found is all CSS / JSS files are in the same array at 1 time. This may not sound like a benefit, but a snippet from another example <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css"> Later on when you want to change system.css, you will ...


5

Joomla provides its own API from their Factory we can call it as JFactory. There is no harm of using: <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css"> over: $document = JFactory::getDocument(); $document->addStyleSheet($url); However, if you are including your stylesheets with above method, ...


4

Yes, there is a built-in cache busting technique. If you use it, your HTML will look like this: <script src="/media/path/foo/bar.js?32af2f62db6e60053132340acc9dfb3c" type="text/javascript"></script> How the cache busting technique works: This works by appending a different series of characters in the URL query section every time that the file ...


3

I'm not sure what the actual issue is, but assuming your email is not rendering the HTML, you simply need to enable it, by using: $mailer->isHTML(true);


3

.navigation .nav-pills { /* add: */ text-align: center; } .nav-tabs > li, .nav-pills > li{ /* float: left; */ display: inline-block; } and change the padding and margin on .nav-tabs > li > a, .nav-pills > li > a{ /* ... */ }


3

In your template.css replace: .servpricing { background: #FFF; color: #000; opacity: 0.3; filter: alpha(opacity=20); } with: .servpricing { background: #fff; // Left as a fallback for older browsers background: rgba(255,255,255,.3); // transparent white color: #000; }


3

Most probably your article editor (TinyMCE?) is cleaning up your code. This is expected behavior by default. Both <iframe> and <form> are among the tags that are removed automatically by TinyMCE. There are a couple of ways around this: Use Sourcerer, a plugin that lets you add HTML (and other kinds of code) directly inside your articles. There's ...


3

Just use an attribute selector. You can target the href attribute in css with [href="#tabs_1a"] for example. I have no experience with jQuery, but the example in GDPs answer uses attribute selectors to add ids, so I'd guess jQuery supports this. The bottom line is that you do not really need to add anything, just use attribute selectors to target something ...


3

Those divs have the classes h2 visible-lg visible-md visible-sm The following code hides those divs. Line: 6685 .visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; } The reason that they are visible in large screens is this code: Line: 6795 @media (min-width: 1200px) { .visible-lg { display: block !important; }..... you ...


2

I'll put this as an answer so I can go into further detail. So you basically need a module with a white background and text on top of it. You initially wanted to have 2 modules. 1 on top of the other. Simply fact is that this is a bad approach and not required at all. To suit your needs, you only need 1 module, so go to your Module Manager, create a new ...


2

If you look at the source code of the page, you'll see that Joomla is using jQuery to append the LI and A elements at runtime. You can use the same technique to add IDs, Classes, CSS, or any other attributes that you may need. Use this jQuery code to add a prefix to the tab's name, then add the ID attribute to the anchor. Note: Insure the code is run ...


2

Firstly, you are using the Joomla 3.0 method for adding tabs. There is a newer method as of Joomla 3.1 which unfortunately is not documented at all apart from the API page. With the new tab method, all you need to do is wrap it round a div with a specific class like so: $options = array( 'useCookie' => true, 'active' => 'tabs_1' ); // Start ...


2

Simply this works for me <?php $options = array( 'active' => 'tab1_id' // Not in docs, but DOES work ); ?> <?php echo JHtml::_('bootstrap.startTabSet', 'ID-Tabs-Group', $options);?> <?php echo JHtml::_('bootstrap.addTab', 'ID-Tabs-Group', 'tab1_id', JText::_('COM_BOOTSTRAPTABS_TAB_1')); ?> <p>Content of the first tab.&...


2

This is not an answer to the question, but is a solution to the problem that prompted the question using the jQuery Cookie Plugin: jQuery(document).ready(function($) { var listItems = $("#tab_group_idTabs li"); var prefix = 'myID-'; listItems.each(function(li) { var a = $(this).children().first("a"); var word = a.attr('href')....


2

you can use this css for transparent backgrounds only background: rgba(255, 255, 255, 0.7);


2

It's simply a shortcut, to save typing I suppose. The documentation calls it a class loader method. JHtml::_("script", "path/to/script.js"); # is the same as: JHtml::script("path/to/script.js"); JHtml::_("stylesheet", "path/to/stylesheet.css"); # is the same as: JHtml::stylesheet("path/to/stylesheet.css"); JHtml::_("jquery.framework"); # is the same as: ...


2

I can't go through your entire CSS, but it looks like your code is not optimized for responsive design. You've been using width:960px in many places, and this breaks the responsive design. Use % or max-width. In addition, you've added your custom code after the default media queries, thus overriding them with fixed widths. Moving your code above the default ...


2

It would be better to just load a JFormFieldRadio it will take care of required scripts. JFormHelper::loadFieldClass('radio'); $field = new JFormFieldRadio(); $field->setup(new SimpleXMLElement('<field name="published" type="radio" size="1" default="0" class="btn-group btn-group-yesno"><option value="0">JNO</option><option value="1"&...


2

Your question consists of two questions, which both are too broad to be explained in details here, plus it seems there is a big gap of knowledge you have to cover. 1. What does happen if i call the site? In the index.php file is php code but i can't find the spot where the rest of the website gets "called" or something. Answer: This question is not ...


2

Don't really know for your template but it can be the good file. It is generally a huge file :) It is protostar/css/template.css for the protostar template shipped with Joomla. Once found, you should search the string @media. These are called Media Queries. They are used to define new style rules for different media types. You can type something like: @...


2

Checkout radiolist option of JHTML JHTML::_('select.radiolist', $options, 'some label' ); Ref: https://docs.joomla.org/API16:JHtmlSelect/radiolist


2

I had to do the same thing. I copied the list form field code and changed it accordingly, so I have 2 functions: getInput() getOptions() which you have In the getInput function, that's what actually creates the list. You'll see a line like the following (the genericlist is also stated in the page you linked to): $html[] = JHtml::_('select.genericlist', $...


2

Had to look into this again and I seem to have found a solution. Just like the publish button rendered using jgrid.published in the example below: <?php echo JHtml::_('jgrid.published', $row->state, $i, 'myitems.', true, 'cb', $row->publish_up, $row->publish_down); ?> Use the more general purpose jgrid.action render instead, which is ...


2

To modify the HTML structure, create a template override. This can be done through Template Manager or by manually copying files through FTP. The documentation already covers this very well: How to override the output from the Joomla! core Understanding Output Overrides - Module Layout Overrides How to use the Template Manager - Creating Overrides


2

Yes. This will be short -- you need to understand the code you're working with because this technique is one of the most powerful ones Joomla affords you and there is basically no documentation of it apart from the code itself, so do it only after tracking through the code and understanding the ramifications. HTMLHelper has a register method you can call to ...


1

Change below code: $.get( urlGet, function( data ) { $('#popupDialogue .popup-content').html(data); $('#popup') .removeClass('loading'); }); to $.get( urlGet, function( data ) { $('#popupDialogue .popup-content').html(data); $('#popup') .removeClass('loading'); $('#popupDialogue .popup-content select').chosen(); });


1

If your website is new, then note that Google doesn't play ads on new websites immediately. Google implemented this a long time ago to ensure that spam websites are filtered out and do not run ads from its network.


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