Joomla! 1.0 component tutorial - part 1: front-end

6. Remaining frontend files

There are few more files in frontend folder: language file, CSS file, and images.
Language file - lang/english.php:
lang/english.php
  1. // no direct access
  2. defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  3.  
  4. // main info
  5.  
  6. DEFINE('_COM_JP_VERSION','0.2');
  7. DEFINE('_COM_JP_DESC',' JPortfSimple - example of Joomla! component');

It's always good to provide language file, instead of using strings inside component, so the component can be translated easier.

CSS file - css/jp.css:

jp.css
  1. /* CSS for JPortSimple
  2. *
  3. * jp.css
  4. */
  5.  
  6. /*********************/
  7. /* frontpage */
  8.  
  9. #jp_front {
  10. position:relative;
  11. float:left;
  12. width:99.5%!important;
  13. width:99.7%;
  14. margin:0px;
  15. }
  16.  
  17. #jp_fronttitle, #jp_cattitle {
  18. position:relative;
  19. font-weight:bold
  20. font-size: 16px; 
  21. border-bottom: 2px solid #ccc;
  22. float:left;
  23. width:94%!important;
  24. width:97%;
  25. padding:10px;
  26. margin:1%;
  27. }
  28.  
  29. and so on
  30. ......

CSS file contains all classes used in divs in the component.

So far I haven't found a tool which would make checking language or css files easier. Now whatever change in the code is done - a text constant added or changed, or CSS class name changed - one has to remember to add/remove/change the respective one in the language or CSS file.