Actions

J1.5

Difference between revisions of "Upgrading your template index file"

From Joomla! Documentation

m (Upgrading your index.php file)
m (Added categorisation.)
(11 intermediate revisions by 6 users not shown)
Line 3: Line 3:
 
# Replace '''_VALID_MOS''' with '''_JEXEC'''
 
# Replace '''_VALID_MOS''' with '''_JEXEC'''
 
# Replace '''$mosConfig_absolute_path''' with '''$this->baseUrl'''
 
# Replace '''$mosConfig_absolute_path''' with '''$this->baseUrl'''
# Replace '''$mosConfig_live_site''' with '''$mainframe->getCfg( 'live_site' )'''
+
# Replace '''$mosConfig_live_site''' with '''JURI::base()'''
 
# Replace fixed strings with translatable strings.  For example, replace '''echo 'Hello'''' with '''echo JText::_( 'Hello' )'''
 
# Replace fixed strings with translatable strings.  For example, replace '''echo 'Hello'''' with '''echo JText::_( 'Hello' )'''
 
# Replace calls to mosGetParam with calls to JRequest::getVar.  For example, replace '''$id = mosGetParam( $_REQUEST, 'id', 0 );''' with '''$id = JRequest::getVar( 'id', 0 );'''
 
# Replace calls to mosGetParam with calls to JRequest::getVar.  For example, replace '''$id = mosGetParam( $_REQUEST, 'id', 0 );''' with '''$id = JRequest::getVar( 'id', 0 );'''
 
# Replace '''mosShowHead();''' with '''<jdoc:include type="head" />'''
 
# Replace '''mosShowHead();''' with '''<jdoc:include type="head" />'''
 
# Replace '''mosMainBody()''' with '''<jdoc:include type="component" />'''
 
# Replace '''mosMainBody()''' with '''<jdoc:include type="component" />'''
# Replace '''mosLoadModules( $position_name, $style );''' with '''<jdoc:include type="modules" name=$position_name style=$style />'''
+
# Replace '''mosCountModules( $position_name );''' with '''$this->countModules( $position_name );'''
 +
# Replace '''mosLoadModules( $position_name, $style );''' with '''<jdoc:include type="modules" name=$position_name style=$style />'''. (''Note: the 1.0 template's PHP syntax may use single or double quotes. Jdoc expressions require double quotes, and won't work with single quotes.'')
  
 
====Module Chrome/Style Conversion Chart====
 
====Module Chrome/Style Conversion Chart====
<table border="1">
+
{| class="wikitable"
<tr>
+
|-
<th>Joomla! 1.0</th>
+
!Joomla! 1.0
<th>Joomla! 1.5</th>
+
!Joomla! 1.5
</tr>
+
|-
<tr>
+
| -3
<td>-3</td>
+
|rounded
<td>rounded</td>
+
|-
</tr>
+
| -2
<tr>
+
|xhtml
<td>-2</td>
+
|-
<td>xhtml</td>
+
| -1
</tr>
+
|raw
<tr>
+
|-
<td>-1</td>
+
|0 or empty
<td>raw</td>
+
|table
</tr>
+
|}
<tr>
+
<noinclude>[[Category:Reference]][[Category:Templates]][[Category:Topics]][[Category:Upgrading]]</noinclude>
<td>0 or empty</td>
+
<td>table</td>
+
</tr>
+
</table>
+
 
+
<noinclude>[[Category:Reference]][[Category:Templates]][[Category:Topics]]</noinclude>
+

Revision as of 13:03, 18 February 2011

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Upgrading your index.php file

  1. Replace _VALID_MOS with _JEXEC
  2. Replace $mosConfig_absolute_path with $this->baseUrl
  3. Replace $mosConfig_live_site with JURI::base()
  4. Replace fixed strings with translatable strings. For example, replace echo 'Hello' with echo JText::_( 'Hello' )
  5. Replace calls to mosGetParam with calls to JRequest::getVar. For example, replace $id = mosGetParam( $_REQUEST, 'id', 0 ); with $id = JRequest::getVar( 'id', 0 );
  6. Replace mosShowHead(); with <jdoc:include type="head" />
  7. Replace mosMainBody() with <jdoc:include type="component" />
  8. Replace mosCountModules( $position_name ); with $this->countModules( $position_name );
  9. Replace mosLoadModules( $position_name, $style ); with <jdoc:include type="modules" name=$position_name style=$style />. (Note: the 1.0 template's PHP syntax may use single or double quotes. Jdoc expressions require double quotes, and won't work with single quotes.)

Module Chrome/Style Conversion Chart

Joomla! 1.0 Joomla! 1.5
-3 rounded
-2 xhtml
-1 raw
0 or empty table