Elxis CMS Forum

Support => Technical support => Topic started by: ROUBOS on November 04, 2008, 06:35:43

Title: new template, new to cms and elxis, please help
Post by: ROUBOS on November 04, 2008, 06:35:43
Hi people,
new to the world of cms and new to elxis. Elxis is the first cms i'm trying out.
I bought the books on creating an elxis template. following the instructions in the book I created my template to use. My template uploads and installs with no errors, but when i open the url i get a blank page.

my template zip file was setup as per the book:

/mytemplate
   index.html
   index.php
   template_thumbnail.png
   templateDetails.xml
   /css
      index.html
      template_css.css
   /images
      index.html
      myimages.png

Anyhelp would be greatly appreciate.. any directions you could give me. Excuse the noob:)

EDIT >>> After doing some research online I noticed I have many things missing from the template. Will read more and work on it. But if anyone reads this and wishes to reply with some feedback.. directions on how to tackle things as a noob, it would be appreciated...

thanks in advance

here is my index.php:
~~~~~~~~~~~~~~
<?php
   defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.');
   $iso = explode ( '=', _ISO );
   $rtl = (_GEM_RTL) ? ' dir="rtl"' : '';
   echo '<?xml version= "1.0" encoding= "'. $iso[1] .'"?'.'>';
?>   
<!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" lang= "<?php echo _LANGUAGE; ?>" xml=lang= "<?php echo _LANGUAGE; ?>"<?php echo $rtl; ?>>
<head>
   <?php mosShowHead(); ?>
    <?php if( $my->id ) { initEditor(); } ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<link href="<?php echo &mosConfig_live_site; ?>/ templates/<?php echo $mainframe->getTemplate(); ?>/css/ template_css<?php echo (_GEM_RTL) ? '-rtl' : ''; ?>.css" rel="stylesheet" type="text/css" media="all" />
</head>

<body>

   <div id="surrounds">
         <div id="header">   
             This is the Header      
       </div>
         <div id="pathway-language">
            <div id="pathway"><?php mosPathWay(); ?></div>
            <div id="langselector"><?php mosLoadModules('language', -1); ?></div>
         </div>   
         <div id="leftcolumn"><?php mosLoadModules ('left');?></div>
       <div id="rightcolumn"><?php mosMainBody(); ?></div>
       <div id="footer"><?php mosLoadModules ('bottom');?></div>
   </div>
   <?php mosLoadModules('debug', -1);?>
</body>
</html>
~~~~~~~~~~~~~~~


and my template_css.css :
~~~~~~~~~~~~~~~~~
* { padding: 0; margin: 0; }
html,body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
background-image:url(images/header_bg.png);
background-repeat:repeat-x;
height:100%;
}
#surrounds {
margin: 0 auto;
width: 800px;
min-height:100%;
}
#header {
width: 800px;
float: left;
padding: 0px;
border: 0;
height: 150px;
margin: 00px 0px 0px 0px;
background-image:url(images/header.png);
border-bottom:1px solid #FFFFFF;
}
#pathway-language {
float: left;
width: 799px;
height: 20px;
padding: 0px;
border: 0;
margin: 0px 0px 0px 0px;
background: #491515;
border-bottom:1px solid #FFFFFF;
border-left:1px solid #FFFFFF;
border-right:1px solid #FFFFFF;
color:#FFFFFF;
}
#pathway {
width:auto;
float:left;
}
#langselector {
padding:0;
float:right;
}
#langselector form {margin:0;}
#leftcolumn {
color: #000000;
border: 0;
background: #C9CAC6;
margin: 0px 0px 0px 0px;
padding: 10px;
width: 178px;
float: left;
border-left:1px solid #FFFFFF;
border-right:1px solid #FFFFFF;
}
#rightcolumn {
float: right;
color: #000000;
border: 0;
background: #E4E6DC;
margin: 0px 0px 0px 0px;
padding: 10px;
width: 579px;
display: inline;
border-right:1px solid #FFFFFF;
}
#footer {
text-align:center;
width: 798px;
height:30px;
clear: both;
color: #333;
border: 0;
background: #5D88B5;
margin: 0px 0px 00px 0px;
padding: 0px;
border:1px solid #FFFFFF;
position:relative;
bottom:0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Title: Re: new template, new to cms and elxis, please help
Post by: datahell on November 04, 2008, 08:14:26
Hi ROUBOS and welcome to Elxis!

Your template looks ok except 1-2 areas.
The DOCTYPE should be "Transitional" and not "Strict". See template "okto" for the proper DOCTYPE.

Remove the index.html from your template root (mytemplate/index.html).

Replace this: &mosConfig_live_site with this: $mainframe->getCfg('live_site')

Don't forget to set the template as default in Elxis administration.
Title: Re: new template, new to cms and elxis, please help
Post by: kebic on November 04, 2008, 09:19:51

and my template_css.css :
~~~~~~~~~~~~~~~~~
* { padding: 0; margin: 0; }
html,body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
background-image:url(../images/header_bg.png);
background-repeat:repeat-x;
height:100%;
}
#surrounds {
margin: 0 auto;
width: 800px;
min-height:100%;
}
#header {
width: 800px;
float: left;
padding: 0px;
border: 0;
height: 150px;
margin: 00px 0px 0px 0px;
background-image:url(../images/header.png);
border-bottom:1px solid #FFFFFF;
}
#pathway-language {
float: left;
width: 799px;
height: 20px;
padding: 0px;
border: 0;
margin: 0px 0px 0px 0px;
background: #491515;
border-bottom:1px solid #FFFFFF;
border-left:1px solid #FFFFFF;
border-right:1px solid #FFFFFF;
color:#FFFFFF;
}
#pathway {
width:auto;
float:left;
}
#langselector {
padding:0;
float:right;
}
#langselector form {margin:0;}
#leftcolumn {
color: #000000;
border: 0;
background: #C9CAC6;
margin: 0px 0px 0px 0px;
padding: 10px;
width: 178px;
float: left;
border-left:1px solid #FFFFFF;
border-right:1px solid #FFFFFF;
}
#rightcolumn {
float: right;
color: #000000;
border: 0;
background: #E4E6DC;
margin: 0px 0px 0px 0px;
padding: 10px;
width: 579px;
display: inline;
border-right:1px solid #FFFFFF;
}
#footer {
text-align:center;
width: 798px;
height:30px;
clear: both;
color: #333;
border: 0;
background: #5D88B5;
margin: 0px 0px 00px 0px;
padding: 0px;
border:1px solid #FFFFFF;
position:relative;
bottom:0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Title: Re: new template, new to cms and elxis, please help
Post by: ROUBOS on November 04, 2008, 16:18:06
Hi,
thanks for your replies.
I have made the changes as per your replies, and installed the template again. For some reason index.html was required to be in my root template folder for the installation to work.
Now it seems to be doing something as the page displays information but not my template. Not my layout and my images I mean...
Title: Re: new template, new to cms and elxis, please help
Post by: ks-net on November 04, 2008, 19:07:43
it obvious  that you ignored and totally left unmodified the template.xml file which is
responsible for a correct installation   ....
every file that listed in that xml will be copied to the server ... not listed will be left out ... listed but not found, installation aborts .

a blank index.html is good to be in subfolders(of course not in root.. you have the index.php) , thats make sure that beside server's configuration (+indexes multiviews etc.) directory listing is impossible,
you don't want to display to any body your folders content.
Title: Re: new template, new to cms and elxis, please help
Post by: ROUBOS on November 04, 2008, 20:04:22
OK  I did modify the xml file and now it's no longer necessary to include the index.html on the root folder.
Installed successfully. The problem I have now is that it only displays the content and not my layout. It's as if the layout i have is ignored.

any thoughts?
Title: Re: new template, new to cms and elxis, please help
Post by: kebic on November 04, 2008, 21:07:06
Url: ?   ???
Title: Re: new template, new to cms and elxis, please help
Post by: ROUBOS on November 05, 2008, 15:41:46
OK got it to work. I changed the PHP code to this:
-------------------------------------------
<?php
   defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$iso = explode( '=', _ISO );
echo '<?xml version="1.0" encoding="'.$iso[1].'"?' .'>'._LEND;
?>
<!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" lang="<?php echo _LANGUAGE; ?>" xml:lang="<?php echo _LANGUAGE; ?>"<?php echo (_GEM_RTL) ? ' dir="rtl"' : ''; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php mosShowHead(); ?>
<link href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $mainframe->getTemplate(); ?>/css/template_css<?php echo (_GEM_RTL) ? '-rtl' : ''; ?>.css" rel="stylesheet" type="text/css" media="all" />
<?php if ( $my->id ) { initEditor(); } ?>
--------------------------------------------------

And now it works.
Time to start organizing content and pages. How the diff-languages work and how to add and remove modules I don't want.

the fun begins :)

If anyone has any good ideas on how to direct me, what to avoid doing etc..... it would be nice.
I installed my template and it's populated with the default content. So everything is done through the admin pages now?
Title: Re: new template, new to cms and elxis, please help
Post by: ks-net on November 05, 2008, 15:57:55
if statements.....


                 <?php if (mosCountModules('user1') >= 1 OR mosCountModules('user2') >= 1 ) {?>

                 <div id="content_top_wrapper">

                 <div id="content_user1"><?php mosLoadModules('user1', -2); ?></div>

                 <div id="content_user2"><?php mosLoadModules('user2', -2); ?></div>

                      </div>

                      <?php

                       }

                       ?>

but before start asking for every step of design your template listen to my advice:

read... 
https://www.elxis.org/guides/
https://www.elxis.org/guides/developers-guides/

and especially>>>  http://www.elxis-downloads.com/fserver/85.html

*************
if you finished with your template... just ignore the code above
and focus to docs.