Anyone know how to add a quick icon or maybe even edit the current list of quick icons in Joomla 3.1? To be more specific, that would be the series of links that appear on the right side of the screen immediately after logging in to Joomla admin. I searched and couldn't find this question on stackoverflow.
QuickIcon's are actually a plug-in.
If you go to Extensions->Plug-in Manager->Plug-ins and select quickicon from the Type filter menu on the left you will see the any QuickIcon plugins you have installed. The default plug-ins are for Update Notifications (one for Joomla and another for Extensions).
If you are creating on as a simple short-cut to existing functionality then you're best of using one of the QuickIcon extensions on the Joomla Extension Directory that do that already. If you're wanting to create a QuickIcon for a custom component you're creating you will need to create your own plug-in.
You can read about Plug-ins here, note that for 3.x there isn't much difference from 2.5.x plugins.
A QuickIcon plug-in consists of several files:
pluginname.php
pluginname.xml
various media files (images, css, js)
While the #3 is optional most plugins will use one or more of them.
If you're going to create your own plug-in I would start by looking at the two notification QuickIcon plugins that ship with Joomla 3.x. You can find them in the /plugins/quickicon/ directory with corresponding media in /media/plg_quickicon_*. As they ship with the core their CSS is in the admin templates CSS' e.g. if you using Isis you will find it in /administrator/templates/isis/css/template.css
If you go to the following file:
administrator/modules/mod_quickicon/helper.php
You will see on the start of line 51, arrays such as the following:
array(
'link' => JRoute::_('index.php?option=com_content&task=article.add'),
'image' => 'file-add',
'icon' => 'header/icon-48-article-add.png',
'text' => JText::_('MOD_QUICKICON_ADD_NEW_ARTICLE'),
'access' => array('core.manage', 'com_content', 'core.create', 'com_content', )
)
Line 1, is the link.
Line 2, go to media/jui/css/icomoon.css to see what is available.
Line 3, I'm not actually too sure about but will update when I do.
Line 4, is the text such as Add New Article, but as you can see
above, it's a language string
Line 5 is the text you see such as "Add New Article", but in the code above, it's a language string
Hope this helps
Here is the standard solution:
Copy the file default.php from
/administrator/modules/mod_quickicon/tmpl/
to
/administrator/templates/YOUR_CURRENT_ADMIN_TEMPLATE/html/mod_quickicon/
and open the copied file. Replace this line
$html = JHtml::_('links.linksgroups', ModQuickIconHelper::groupButtons($buttons));
with these lines:
$myLinks = array(
'COM_YOUR_COMPONENT_QUICKICON_YOUR_GROUP' => array(
array(
'link' => JRoute::_('index.php?option=com_YOUR_COMPONENT'),
'image' => 'pictures',
'icon' => 'header/icon-48-article-add.png',
'text' => JText::_('COM_YOUR_COMPONENT_QUICKICON_YOUR_ITEM'),
'access' => array('core.manage', 'com_YOUR_COMPONENT'),
'group' => 'COM_YOUR_COMPONENT_QUICKICON_YOUR_GROUP'
),
)
);
$array = ModQuickIconHelper::groupButtons($buttons);
$array = array_merge($myLinks, $array);
$html = JHtml::_('links.linksgroups', $array);
For languages, use overrides like this:
/administrator/language/overrides/en-GB.override.ini
Quickicons can be added easily using plugin in Joomla 3.x and Joomla 2.5
This plugins can be used as an example https://github.com/joomla/joomla-cms/tree/staging/plugins/quickicon/joomlaupdate
Related
I have built a small web application using Laravel 8 and I was requested to integrate AdminLTE to it.
I am new to AdminLTE and part of the requirements is to translate the pages content, but I had no idea of how to create such menu.
The idea is to come to this:
Here I want explain how I got there. It took me some hours to understand how this works so I think someone else could benefit from my work.
I am assuming you have already successfully integrated the AdminLTE dashboard to your Laravel application.
The key is to open the file C:\your_web_app_folder\config\adminlte.php with your preferred text editor.
Find the "Menu Items" section and add the following text inside the 'menu' => [] element:
[
'text' => 'Language',
'topnav_right' => true,
'icon' => 'flag-icon flag-icon-us',
'submenu' => [
[
'text'=>'English',
'icon' => 'flag-icon flag-icon-us',
'url'=> '#'
],
[
'text'=>'Khmer',
'icon' => 'flag-icon flag-icon-kh',
'url'=> '#'
]
]
],
Such text can be inserted after the search textbox or wherever you consider it more convenient to you.
The 'text' sets the text that will be shown on your link (optional).
The 'topnav_right' indicates that the language menu will be located on the right side of the navigation bar.
The 'icon', in this case, is going to contain the CSS class that will display the desired icon flag. For this to work, it is necessary to load the respective CSS file which is located in the folder \public\vendor\flag-icon-css\css\flag-icon.css, assuming you previously published those assets using the artisan commands specified in the documentation (https://github.com/jeroennoten/Laravel-AdminLTE/wiki/5.-Artisan-Console-Commands)
Proceeding like this you will have all those CSS/JS/images copied to your \public\vendor folder for easier reference.
There is nothing else to do to create those menus you see on the top nav (notifications, messages, languages, etc). All of them can be built in the same way.
I want to add alt tag in this,but when I use this, It doesnot work.
'244','height' => '163','id' => 'image1','default' => ipThemeUrl('assets/img/ani.png'), 'class' => 'img-responsive'); echo ipSlot('image', $options); ?>
I dug into code. Unfortunately, alt tag is not implemented in the core at the moment.
If you really need this, you can check other slots how they implement attributes and do the same for this slot. Then create a pull request on GitHub and it will be added to the core with next release.
I'm running JomSocial 3.2 on Joomla 3.
I want to add some content to the right side of the registration page.
Some pictures and other contents.
So far, i've been able to get to the "register.index.php" file,
which is the file that displays some of the content in the homepag.
The file is in: "/site_root/components/com_community/templates/default/" folder
but i've not been able to fully edit the whole registration page.
This could be done in many different ways - even without editing any file. Install this extension: http://extensions.joomla.org/extension/advanced-module-manager and when editing module you'll have additional tab called "tasks" There will be field URL, type inside URLs of your registration form. Thanks to this you'll be able to assign modules to registration form.
You could also override for:
ROOT/components/com_community/templates/default/register.index.php
Copy it to:
ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)
Then you may create module position inside file using this code:
$modules = JModuleHelper::getModules( 'reg-positon' );
foreach ($modules as $module) {
$_options = array( 'style' => 'xhtml' );
echo JModuleHelper::renderModule( $module, $_options );
}
Above code creates module position: "reg-positon'. You'll need to type this name manually as it will be not listed on module positions list.
Now you'll need a bit of html to display it on right or left of registration form.
When I'm designing Wordpress sites for clients, many of the theme designs I use consist of several posts, each with one photo and a bit of text. As a result, I end up spending lots of time creating lots of posts with one picture each-- just so the layout works as expected. It seems like there should be a way to bulk add images to the Media folder (I use the Add from Server plugin) and then tell WP to create a bunch of separate posts containing one photo each.
Does anyone know how to do this? It seems like professional theme designers would get a lot of use out of a plugin that did this automatically.
Thanks!
Chimera
I looked around for a solution to this problem too, but just ended up writing my own plugin to do it.
Auto Create Posts From Images
If you wanted to do it yourself,
global $user_ID;
$new_post = array(
'post_title' => 'My New Post',
'post_content' => 'Lorem ipsum dolor sit amet...',
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
'post_author' => $user_ID,
'post_type' => 'post',
'post_category' => array(0)
);
$post_id = wp_insert_post($new_post);
and there is good info in the docs:
WP Docs
You could make a default set of images and export the sql records that go with it.
So set up of a new site you could import both the files and the sql so you have images ready.
The functionality you want can be made, nextgen does scan it's folders.
I have created my first Magento widget on a test site (same code and configuration as my live site). The widget works perfectly on the test site. However, having moved the code to the live site, I can configure the widget instance, but the output of the widget is not showing on the product page. So I know Magento is pulling information from the widget's config.xml and widget.xml files.
I have confirmed that the correct layout update is being inserted in the core_layout_update table. The information on the live system's table is exactly the same as that on the working test site.
I have confirmed that the file permissions and ownership are correct on the live site.
I have confirmed that I can put another (Magento supplied) widget in the exact spot on the configurable product page (Product Extra Info). So I know that my templating, etc. is not getting in the way of adding the widget in that spot.
I've tried deleting the widget instance and recreating a new instance of the same widget.
I have compared the code to the test site and copied the code straight from the test site. Still no success. I have enabled php_flag display_errors in .htaccess and no errors are shown. And no errors are showing in the exception.log when enabled.
The live and test systems are on different servers, different OS's, different versions of PHP (both 5.3.x). I've refreshed all the caches and confirmed that the test widget is showing so I don't think this is a caching issue.
How is the best way to confirm that Magento on the live site can actually access or find the Block code for my widget? As indicated I know Magento is accessing the widget.xml file in my local code directory. Not sure if installing Alan Storm's CommerceBug is the way to trace or dump what Magento is trying to load (modules, widgets, etc) for the page in question.
Verify that you have your xml in the /app/etc/modules folder.
You can turn on Block Hints by going to Admin->System->Configuration->Advanced->Developer, change the Current Configuration Scope to Main Website and click on Debug. Change Template Path Hints to Yes and save.
Verify your filenames. This has gotten me a number of times. I develop on a Mac (non case-sensitive), and occasionally when I upload to Linux (case-sensitive), it breaks. One of the first thing I check is the file name's case.
Ensure that the class name matches the filename.
The next step I'd take is to take a look at the final page layout xml generated for the page your'e adding the widget to and ensure a bit of Layout XML is being added to the page for your widget. If it isn't, there's something wrong with the Layout XML Updates that are added to the table via the widget UI. If it is, then start debugging why the particular chunk of generated layout XML isn't being added to the page.
This is the top-down approach to debugging the problem, but it's the only way I know to be sure.
I had the same problem. It's my decision:
app\code\local\Mage\Core\Model\Resource\Layout.php
When 'theme' => Mage::getSingleton('core/design_package')->getTheme('layout') result is not correct: 'theme' => 'multistore', should be 'theme' => 'your_theme'.
So, delete argument 'layout' in function getTheme() and get right result
*/
class Mage_Core_Model_Resource_Layout extends Mage_Core_Model_Resource_Db_Abstract
{
...
public function fetchUpdatesByHandle($handle, $params = array())
{
$bind = array(
'store_id' => Mage::app()->getStore()->getId(),
'area' => Mage::getSingleton('core/design_package')->getArea(),
'package' => Mage::getSingleton('core/design_package')->getPackageName(),
// 'theme' => Mage::getSingleton('core/design_package')->getTheme('layout')
'theme' => Mage::getSingleton('core/design_package')->getTheme()
);
foreach ($params as $key => $value) {
if (isset($bind[$key])) {
$bind[$key] = $value;
}
}
$bind['layout_update_handle'] = $handle;
$result = '';
$readAdapter = $this->_getReadAdapter();
if ($readAdapter) {
$select = $readAdapter->select()
->from(array('layout_update' => $this->getMainTable()), array('xml'))
->join(array('link'=>$this->getTable('core/layout_link')),
'link.layout_update_id=layout_update.layout_update_id',
'')
->where('link.store_id IN (0, :store_id)')
->where('link.area = :area')
->where('link.package = :package')
->where('link.theme = :theme')
->where('layout_update.handle = :layout_update_handle')
->order('layout_update.sort_order ' . Varien_Db_Select::SQL_ASC);
$result = join('', $readAdapter->fetchCol($select, $bind));
}
return $result;
}
}