Archive for category CMS
Magento – check if user logged in
Many times, you may want to check if a user is logged in while using Magento, to do so, you could use one of the many helper function to do so. The top class for it is Class Mage_Customer_Helper_Data, the method we are going to use is isLoggedIn(), let’s write a simple script to check if a user is logged in:
<?php
if ($this->helper('customer')->isLoggedIn() ) {
echo "Welcome!";
} else {
echo "Please log in.";
}
?>
Magento Display Product SKU
If you happen to use Magento to develop your e-commerce site, and want to display SKU number on your product page, here is how you can use the magic method getSku to do it. On your app/design/frontend/default/default/template/catalog/product/view.phtml page, add in the line below:
<?php echo 'RN #'.nl2br($_product->getSku()) ?>
Google Gadgets in Joomla Custom HTML module
To include syndicated Google Gadgets in a Joomla! site using the Custom HTML module (mod_custom) is very easy. This page lists all openly syndicated Gadgets:
Just find a Gadget and select “Add to your webpage”. Then set any parameters and click “Get the code”. Copy and paste the code into the source of a Custom HTML module in your Joomla! admin, and you have a Google Gadget on your site!
By the way, remember to turn off any code cleanup options you may have on in your Editor or the SCRIPT tags will get stripped out by the filter when you save.
Of course, except for width and height, you don’t have much control over the look of most Gadgets. But this easily can be corrected by viewing the code on a particular Gadget’s “about” page, tweaking it, and submitting it as a new syndicated Gadget that looks the way you want.
So, if you can’t find the Joomla! module you’re looking for, you might consider looking for a Google Gadget that does what you want instead.
Empty Joomla! Forum PM-box
in the Joomla! forum, if your PM-box is full and nobody can send you anymore messages, there is a way to solve this. The solution is to go to your messages and “check” the box and click delete for those you want to delete. Do take note that you should read them first before you delete them!
Change Date Format in Joomla!
The date format information for Joomla! 1.5 and above is stored in the file <Joomla! home>/language/<your language>/<your language>.ini. For example, in English, it is <Joomla! home>/en-GB/en-GB.ini.
To change the date format, find and edit the values “DATE_FORMAT_LCx”. By default, the date is in international format (for example, Thursday, 31 January 2008 18:30). To change to standard US format (for example, Thursday, January 31, 2008, 06:30 PM), make the following changes:
DATE_FORMAT_LC=%A, %B %d, %Y DATE_FORMAT_LC1=%A, %B %d, %Y DATE_FORMAT_LC2=%A, %B %d, %Y %I:%M %p DATE_FORMAT_LC3=%B %d, %Y DATE_FORMAT_LC4=%m.%d.%y DATE_FORMAT_JS1=m-d-y %Y-%M-%D=%Y-%M-%D %A, %B %E=%A, %B %e
These are the formats for the time
%H:%M = 00:00 through 23:59 %k:%M = 0:00 through 23:59
%I:%M %P = 00:00 am through 23:59 pm (I = upercase i) %l:%M %P= 0:00 am through 23:59 pm (l = lowercase L)
(Note that %P will print the lowercase am/pm indicator for your locale, which may be blank.)
%I:%M %p = 00:00 AM through 23:59 PM (I = upercase i) %l:%M %p= 0:00 AM through 23:59 PM (l = lowercase L)
Display RSS feed in Joomla!
Here are the steps to display RSS feed in your Joomla! site:
1. Go to extensions>>Module Manager
2. Find the Feed Display module
3. Enter the URL of the feed.
4. Save and display the module like any other module.
However there is a second way, which is to use the News Feeds component that comes with Joomla!
1. In the administrator go to components>>News Feeds
2. In the component you can manage your news feeds and assign them to categories.
3. To show the feeds on the front end make a component link in your menu.
Joomla change favicon
Favicon is the favorites icon that is associated with your site and appears in the left of your browser address bar. Both Joomla! 1.0.x and 1.5.x come with a default favicon that displays the Joomla! Logo. You may change that as long as your new favicon is in the ICO format and sized 16×16 pixels. Here’s how to do it:
Unlike the 1.0.x versions, the only name you are allowed to use for your favicon is favicon.ico but you are offered the flexibility to associate different favicons with different templates. You only need to upload your favicon.ico into the main folders of your front-end and back-end templates, which are found in the /templates/ and the /administrator/templates/ folders respectively, overwriting any favicon files that came with your templates.
However, if you’d rather use a global favicon for all your templates themes, just upload it into Joomla!’s main folder (that’s where your index.php resides) and into the /administrator/ folder. Make sure you delete all favicon.ico files found in the template folders mentioned above because Joomla! will check your template folder first for the favicon.ico file.
Please take note that to see the new favicon you will need to empty your browser cache.
Joomla Put Module Inside Article
While using Joomla! to build a content management site, you may want to put module inside article in Joomla!
to associate modules with articles in some way. The modules are allocated to module positions and the module positions appear somewhere on the web page as determined by the template. However, it is sometimes useful to have a module actually embedded in the article content itself.
To insert a module inside an article you can use the “{loadposition xx}” command, as follows:
1. Create a module and set its position to any value that doesn’t conflict with an existing template position. You can type in the position value instead of selecting it from the drop-down list. For example, use the position “mypositionA”.
2. Assign the module to the Menu Items that contain the articles that you want the module to show in. You can also just assign the module to “All” Menu Items.
3. Edit the articles where you want this module to show and insert the text “{loadposition myposition}” in the article, at the place where you want the module to show.
The module will show at that point in the article.
Note that this method only works when the plugin ‘Content – Load Module’ is enabled. If this plugin is disabled, the text “{loadposition myposition}” shows unchanged in the article.
Joomla Block or Delete Super Administrator
If you try to delete or block a user who is a Super Administrator, you will get an error message saying “You cannot delete (block) a Super Administrator”. If you need to delete, block such a user, do it in two steps as follows:
In the User Manager, change the user’s group to something other than “Super Administrator”. For example, change the user to the “Registered” group. Press Save or Apply to save the change you have made.
As of 1.5.9, if the Super Administrator is already blocked (since 1.5.9 seems to not allow blocking a Super Administrator, this is probably an obscure case where the Super Administrator was blocked, then Joomla! upgraded) unblock him/her and Save. then demote the user, then…
Delete or block the user in the normal manner. To delete, select the user in the User Manager and press the Delete icon in the toolbar. To block the user, open the user for editing and set “Block User” to “Yes”.
Remove Powered by Joomla!
Joomla 1.5
Starting with Joomla 1.5 onwards, Internationalization and full support of UTF-8, messages for footer.php and other Joomla pages has been moved to a language specific file.
If you want to change the ‘Powered by Joomla!’ text, go to the language directory, go to the folder of the language you want to change, look for the mod_footer.ini file and change the relevant text. For British English, the specific file is language/en-GB/en-GB.mod_footer.ini. Remember that you may not be able to remove copyright and license information from the source code.
If you want to remove the footer entirely, go to Extensions > Module Manager and unpublish the footer module.
Other places in the source code where you can look for options to make changes are these – If you find code related to footers in these files, you can either comment it out or remove it:
* /includes/footer.php file.
* index.php file for your active template
For Joomla 1.0
You may remove that message, which is in footer.php. You may however not remove copyright and license information from the source code.










































