Actions

J1.5

Difference between revisions of "Customising the JA Purity template/customisations/Centering the hornav"

From Joomla! Documentation

< J1.5:Customising the JA Purity template‎ | customisations
m (Start edit session)
m (Applied tutorial template and removed categories)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{inuse}}
+
{{:Customising the JA Purity template/tutorialtemplate|index.php and ja-sosdmenu.css|<pre>
 +
    <location of template>/
 +
        index.php
 +
        css/
 +
            ja-sosdmenu.css
 +
</pre>}}
  
The simpliest way to center the hornav menu, in Ja_Purity template, is to edit the file ''templates\ja_purity\index.php''.
+
You can edit the file directly in your choice of plain text editors such as VI or Notepad or you can use the HTML Editor provided in the Joomla Administration area.  
  
Open with a text editor that file; about at line 145 you will find:
+
#To use the Joomla editor just log into the Administration area of your site
<pre>
+
#Open the Template Manager [[Image:JA_Purity_Tutorial_TemplateManager0.jpg|thumb|right]]
  <!-- BEGIN: MAIN NAVIGATION -->
+
#Click on your version of the JA purity template or
  <?php if ($this->countModules('hornav')): ?>
+
#Click the Edit button [[Image:JA Purity Tutorial EditButton.jpg|tumb|right]]
  <div id="ja-mainnavwrap">
+
#Click the HTML Editor icon in the upper right [[Image:JA Purity Tutorial EditHTMLButton.png|thumb|right]]
  <div id="ja-mainnav" class="clearfix"> <---- EDIT THIS
+
#Near line 93 you will find:
  <jdoc:include type="modules" name="hornav" />
+
#:<pre>
  </div>
+
#:<style type="text/css">
  </div>
+
#: #ja-header,#ja-mainnav,#ja-container,#ja-botsl,#ja-footer {width: <?php echo $tmpWidth; ?>;margin: 0 auto;}
  <?php endif; ?>
+
#: #ja-wrapper {min-width: <?php echo $tmpWrapMin; ?>;}
  <!-- END: MAIN NAVIGATION -->
+
#:</style>
</pre>
+
#:</pre>
 
+
#Change the class #ja-mainnav to #ja-mainnavwrap in the style section above
In the signed line add these style information: '''''width: 500px; margin: 0 auto;'''''
+
#Save and close the HTML file
You will obtain something like it:
+
#Click the CSS Editor icon in the upper right [[Image:JA Purity Tutorial EditCssButton.png|thumb|right]]
<pre>
+
#Click the ja-sosdmenu.css radio button [[Image:JA Purity Tutorial Ja-sosdmenuCss.jpg|thumb|right]]
  <div id="ja-mainnavwrap">
+
#Click the Edit button to begin editing ja-sosdmenu.css
  <div id="ja-mainnav" class="clearfix" style="width: 500px; margin: 0 auto;">  <-- EDITED
+
#Near line 12 you will find:
  <jdoc:include type="modules" name="hornav" />
+
#:<pre>
  </div>
+
#: #ja-mainnav, #ja-mainnav ul {
  </div>
+
#: padding: 0;
</pre>
+
#: margin: 0;
<noinclude>
+
#: line-height: 20px;
[[Category:Beginners]]
+
#:}
[[Category:JA Purity template]]
+
#:</pre>
[[Category:Tutorials]]
+
#Add the following before line 12
</noinclude>
+
#:<pre>
 +
#: #ja-mainnavwrap {
 +
#: max-width: 960px; <--- EDIT THIS
 +
#: margin: 0;
 +
#:}
 +
#:</pre>
 +
#Change the above line to suit max width
 +
#You will probably also want to add the same line to the ja-sosdmenu-rtl.css file as well
 +
#Finished

Revision as of 16:55, 15 January 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.

The original JA Purity template was provided from JoomlArt.com as a zip but the latest files have been installed along with Joomla. The relevant files, index.php and ja-sosdmenu.css, can be found in templates/ja_purity. If you've been following the tutorial, you can download a tutorial version of the template that installs to the templates/my_japurity folder. Inside the folder of the template, the files are located as follows:

    <location of template>/
        index.php
        css/
            ja-sosdmenu.css

You can edit the file directly in your choice of plain text editors such as VI or Notepad or you can use the HTML Editor provided in the Joomla Administration area.

  1. To use the Joomla editor just log into the Administration area of your site
  2. Open the Template Manager
    JA Purity Tutorial TemplateManager0.jpg
  3. Click on your version of the JA purity template or
  4. Click the Edit button
    tumb
  5. Click the HTML Editor icon in the upper right
    JA Purity Tutorial EditHTMLButton.png
  6. Near line 93 you will find:
    <style type="text/css">
    #ja-header,#ja-mainnav,#ja-container,#ja-botsl,#ja-footer {width: <?php echo $tmpWidth; ?>;margin: 0 auto;}
    #ja-wrapper {min-width: <?php echo $tmpWrapMin; ?>;}
    </style>
  7. Change the class #ja-mainnav to #ja-mainnavwrap in the style section above
  8. Save and close the HTML file
  9. Click the CSS Editor icon in the upper right
    JA Purity Tutorial EditCssButton.png
  10. Click the ja-sosdmenu.css radio button
    JA Purity Tutorial Ja-sosdmenuCss.jpg
  11. Click the Edit button to begin editing ja-sosdmenu.css
  12. Near line 12 you will find:
    #ja-mainnav, #ja-mainnav ul {
    padding: 0;
    margin: 0;
    line-height: 20px;
    }
  13. Add the following before line 12
    #ja-mainnavwrap {
    max-width: 960px; <--- EDIT THIS
    margin: 0;
    }
  14. Change the above line to suit max width
  15. You will probably also want to add the same line to the ja-sosdmenu-rtl.css file as well
  16. Finished