J3.x

Difference between revisions of "Converting A Previous Joomla! Version Template"

From Joomla! Documentation

(Created page with "This is a work in progress. Converting your template to work with the Joomla 3 release involves a number of steps. Because Joomla 3 uses the Twitter Bootstrap framework many cl...")
 
(Remove needs review. Page largely not relevant anymore)
 
(30 intermediate revisions by 7 users not shown)
Line 1: Line 1:
This is a work in progress.
+
<noinclude><languages /></noinclude>
  
Converting your template to work with the Joomla 3 release involves a number of steps.  Because Joomla 3 uses the Twitter Bootstrap framework many class and id names have changed. Also to take advantage of Bootstrap you will want to include certain files.
+
{{Version/tutor|3.x}}
  
 +
''If you any tips for users based on your experience please feel free to edit this page and add them to the list''
  
===Class names===
+
<translate>
 +
<!--T:1-->
 +
Converting your template to work with the Joomla 3 release involves a number of steps.  Because Joomla 3 uses the [http://twitter.github.com/bootstrap/ Twitter Bootstrap framework] many class and id names have changed. Also to take advantage of Bootstrap you will want to include certain files.
 +
</translate>
  
{| border="1" cellspacing="0" cellpadding="5" align="center"
+
<translate>
! 2.5
+
<!--T:2-->
! 3
+
This is not going to give you the results you would get by fully incorporating JUI into a template, but it will do as a work around and give some time to transition or fully go in a different direction if you prefer not to incorporate it at all.
 +
</translate>
 +
 
 +
<translate>
 +
<!--T:3-->
 +
In some cases where you have heavily styled a layout or relied on MooTools features you may want to use overrides with the 2.5 layouts as a temporary bridge.
 +
</translate>
 +
 
 +
<translate>
 +
== HTML == <!--T:4-->
 +
 
 +
===Class names=== <!--T:5-->
 +
</translate>
 +
 
 +
{| class="wikitable"
 +
! Joomla! 2.5
 +
! Joomla! 3.x
 +
! notes
 
|-  
 
|-  
 
| menu
 
| menu
 
| nav
 
| nav
 +
|
 
|-
 
|-
 
| pagnav
 
| pagnav
 
| pager
 
| pager
 +
|
 
|-  
 
|-  
 +
| actions
 +
| dropdown-menu
 +
| <translate><!--T:6-->
 +
This will give you text but no icons</translate>
 
|}
 
|}
  
  
 +
<translate>
 +
===Index.php=== <!--T:14-->
 +
Add this code before including the head to load Bootstrap.
 +
</translate>
  
===Editor views===
+
<source lang="php">
 +
JHtml:: ('bootstrap.framework');
 +
JHtml:: ('bootstrap.loadCss', true, $this->direction); ?>
 +
</source>
  
 +
<translate>
 +
===Editor views=== <!--T:15-->
 +
</translate>
 +
 +
<translate>
 +
<!--T:16-->
 
The front end editor views use tabs to separate editing areas and options. If you don't wish to use these you will need to make an override that does not include this block:
 
The front end editor views use tabs to separate editing areas and options. If you don't wish to use these you will need to make an override that does not include this block:
<code>
+
</translate>
<ul class="nav nav-tabs">
+
 
<li class="active"><a href="#editor" data-toggle="tab"><?php echo JText::_('JEDITOR') ?></a></li>
+
<source lang="html4strict">
<?php if ($params->get('show_urls_images_frontend') ): ?>
+
<ul class="nav nav-tabs">
<li><a href="#images" data-toggle="tab"><?php echo JText::_('COM_CONTENT_IMAGES_AND_URLS') ?></a></li>
+
    <li class="active"><a href="#editor" data-toggle="tab"><?php echo JText::_('JEDITOR') ?></a></li>
<?php endif; ?>
+
    <?php if ($params->get('show_urls_images_frontend')) : ?>
<li><a href="#publishing" data-toggle="tab"><?php echo JText::_('COM_CONTENT_PUBLISHING') ?></a></li>
+
    <li><a href="#images" data-toggle="tab"><?php echo JText::_('COM_CONTENT_IMAGES_AND_URLS') ?></a></li>
<li><a href="#language" data-toggle="tab"><?php echo JText::_('JFIELD_LANGUAGE_LABEL') ?></a></li>
+
    <?php endif; ?>
<li><a href="#metadata" data-toggle="tab"><?php echo JText::_('COM_CONTENT_METADATA') ?></a></li>
+
    <li><a href="#publishing" data-toggle="tab"><?php echo JText::_('COM_CONTENT_PUBLISHING') ?></a></li>
</ul>
+
    <li><a href="#language" data-toggle="tab"><?php echo JText::_('JFIELD_LANGUAGE_LABEL') ?></a></li>
</code>
+
    <li><a href="#metadata" data-toggle="tab"><?php echo JText::_('COM_CONTENT_METADATA') ?></a></li>
 +
</ul>
 +
</source>
 +
 
 +
<noinclude>
 +
<translate>
 +
<!--T:17-->
 +
[[Category:Template Development]]
 +
[[Category:Tutorials]]
 +
</translate>
 +
</noinclude>

Latest revision as of 06:44, 30 March 2020

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français • ‎български • ‎русский


If you any tips for users based on your experience please feel free to edit this page and add them to the list

Converting your template to work with the Joomla 3 release involves a number of steps. Because Joomla 3 uses the Twitter Bootstrap framework many class and id names have changed. Also to take advantage of Bootstrap you will want to include certain files.

This is not going to give you the results you would get by fully incorporating JUI into a template, but it will do as a work around and give some time to transition or fully go in a different direction if you prefer not to incorporate it at all.

In some cases where you have heavily styled a layout or relied on MooTools features you may want to use overrides with the 2.5 layouts as a temporary bridge.

HTML[edit]

Class names[edit]

Joomla! 2.5 Joomla! 3.x notes
menu nav
pagnav pager
actions dropdown-menu This will give you text but no icons


Index.php[edit]

Add this code before including the head to load Bootstrap.

JHtml:: ('bootstrap.framework');
JHtml:: ('bootstrap.loadCss', true, $this->direction); ?>

Editor views[edit]

The front end editor views use tabs to separate editing areas and options. If you don't wish to use these you will need to make an override that does not include this block:

<ul class="nav nav-tabs">
    <li class="active"><a href="#editor" data-toggle="tab"><?php echo JText::_('JEDITOR') ?></a></li>
    <?php if ($params->get('show_urls_images_frontend')) : ?>
    <li><a href="#images" data-toggle="tab"><?php echo JText::_('COM_CONTENT_IMAGES_AND_URLS') ?></a></li>
    <?php endif; ?>
    <li><a href="#publishing" data-toggle="tab"><?php echo JText::_('COM_CONTENT_PUBLISHING') ?></a></li>
    <li><a href="#language" data-toggle="tab"><?php echo JText::_('JFIELD_LANGUAGE_LABEL') ?></a></li>
    <li><a href="#metadata" data-toggle="tab"><?php echo JText::_('COM_CONTENT_METADATA') ?></a></li>
</ul>