Upgrading your template index file: Difference between revisions
From Joomla! Documentation
New page: ===Upgrading your index.php file=== # Replace '''_VALID_MOS''' with '''_JEXEC''' # Replace '''$mosConfig_absolute_path''' with '''$this->baseUrl''' # Replace '''$mosConfig_live_site''' wi... |
m −Category:Reference; −Category:Templates; −Category:Topics; −Category:Upgrading; +Category:Archived version Joomla! 1.5 using HotCat |
||
| (14 intermediate revisions by 8 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 ''' | # 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 );''' | ||
<noinclude>[[Category: | # 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==== | |||
{| class="wikitable" | |||
|- | |||
!Joomla! 1.0 | |||
!Joomla! 1.5 | |||
|- | |||
| -3 | |||
|rounded | |||
|- | |||
| -2 | |||
|xhtml | |||
|- | |||
| -1 | |||
|raw | |||
|- | |||
|0 or empty | |||
|table | |||
|} | |||
<noinclude> </noinclude> | |||
[[Category:Archived version Joomla! 1.5]] | |||
Latest revision as of 04:39, 26 June 2013
Upgrading your index.php file
- Replace _VALID_MOS with _JEXEC
- Replace $mosConfig_absolute_path with $this->baseUrl
- Replace $mosConfig_live_site with JURI::base()
- 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 mosShowHead(); with <jdoc:include type="head" />
- Replace mosMainBody() with <jdoc:include type="component" />
- 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
| Joomla! 1.0 | Joomla! 1.5 |
|---|---|
| -3 | rounded |
| -2 | xhtml |
| -1 | raw |
| 0 or empty | table |