Jump to content

My first template code "newbie"

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Latina.ecu

Latina.ecu

    Newbie

  • Members
  • PipPip
  • 17 posts
I am trying to build my first joomla template i have choosen the mozilla Komposer editor, cause i need a portable tool to work on it, someone told me that (the Joomla API and php. Kompozer isn't going to give me a WYSIWYG solution to making it work with the API.

Could please someone give me a brief better idea of what this really mean

this is the code, i hope someone point me out the right way to make a template with no deprecated code, the main meaning of making this is to learn actual programming languages.

I know dreamweaver would be the best, but i am looking for a second free option

This is my index.php

<?php 

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 

$iso = split( '=', _ISO ); 

echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; 

?> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head>

 <?php if ( $my->id ) initEditor(); ?> 

 <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> 

 <?php mosShowHead(); ?> 

 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['mosConfig_live_site']; ?>/templates/yourtemplatesname/css/template_css.css" /> 

 </head>

 <body> 

 </body> 

 </html>



#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Well, your first line of code is for older versions of Joomla! (Before 1.5):

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 
Which simply states that if this script isn't executed by Joomla! then die.

Joomla! 1.5 uses:
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' ); 
This line will also not work in Joomla! 1.5:
 <?php if ( $my->id ) initEditor(); ?> 
Joomla 1.5:
if( defined( '_JEXEC' )) {
        $user           =& JFactory::getUser();
        $my->gid = $user->get('aid', 0);
    }
I don't like Dreamweaver and I don't recommend it. It is slow, clunky and has memory leaks. Use notepad, notepad2, notepad++ or vi.

#3
Latina.ecu

Latina.ecu

    Newbie

  • Members
  • PipPip
  • 17 posts
Thanks for your reply, i made the changes, actually my instalation is joomla 10.x but i am planning to upgrade to 1.5 i think is the best way to learn, i wonder if is necessary to change the encoding in this code cause i want to have the option to publish menu items and documents with different language characters, like Mandarin, Russian and others.

<?php 

defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' ); 

$iso = split( '=', _ISO ); 

echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; 

?> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head>

<title>My website</title>

if( defined( '_JEXEC' )) { 

$user =& JFactory::getUser(); 

$my->gid = $user->get('aid', 0); 

}

 <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> 

 <?php mosShowHead(); ?> 

 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['mosConfig_live_site']; ?>/templates/yourtemplatesname/css/template_css.css" /> 

 </head>

 <body> 

 </body> 

 </html>


#4
Latina.ecu

Latina.ecu

    Newbie

  • Members
  • PipPip
  • 17 posts
i have added some code here, but i am getting one line as an error

'; ?> if( defined( '_JEXEC' )) { $user =& JFactory::getUser(); $my->gid = $user->get('aid', 0); }

this is the modified code, i am not sure if i am doing it right, actually the layout i am trying to get is something like this at least the first page or intro design

this is the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /><title>Welcome to my Website</title>

</head>
<body><?php 
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' ); 
$iso = split( '=', _ISO ); 
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; 
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<title>My website</title>
if( defined( '_JEXEC' )) { 
$user =& JFactory::getUser(); 
$my->gid = $user->get('aid', 0); 
}
 <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> 
 <?php mosShowHead(); ?> 
 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['mosConfig_live_site']; ?>/templates/yourtemplatesname/css/template_css.css" /> 
 </head>
 <body> <table width="700" border="0" cellpadding="0" cellspacing="0"> 
 <tr align="center"> 
 <td height="50" colspan="3">SITE NAME </td> 
 </tr> 
 <tr align="center"> 
 <td colspan="3">Pathway/breadcrumb</td> 
 </tr> 
 <tr> 
 <td width="150" valign="top">Left modules</td> 
 <td width="400" valign="top"><p>Main content</p> 
 <p>More main content</p></td> 
 <td width="150" valign="top">Right modules </td>
 </tr>
 <tr align="center"> 
 <td colspan="3">Some footer text. </td> 
 </tr> 
 </table> 
 </body> 
 </html>


#5
Latina.ecu

Latina.ecu

    Newbie

  • Members
  • PipPip
  • 17 posts
reading here and there it seems that tableless layout is the best choice but what are the other options to get a table looking layot without tables?

I have created already a template_css folder and file i gues i must do something there.

<?php 

defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' ); 

$iso = split( '=', _ISO ); 

echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; 

?> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head>

<title>My website</title>

if( defined( '_JEXEC' )) { 

$user =& JFactory::getUser(); 

$my->gid = $user->get('aid', 0); 

}

 <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> 

 <?php mosShowHead(); ?> 

 <link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['mosConfig_live_site']; ?>/templates/yourtemplatesname/css/template_css.css" /> 

 </head>

 <body> 

 </body> 

 </html>