Elxis CMS Forum

Extensions => Templates => Topic started by: armpouniotis on July 24, 2008, 23:36:37

Title: Create new template
Post by: armpouniotis on July 24, 2008, 23:36:37
Hi all !

I used so far elxis 2006.4. Now i have deciede to use 2008 version. When i was looking the "Okto" template, and I would like to ask you some questions:

i always use tables instead of div. Will this be a problem ???
About the Stylesheet: Can i use only one stylesheet instead of 2 -3 ???
Moreover, can I use this header in my template ? : <link href="<?php echo $mosConfig_live_site;?>/templates/idrogios2/css/template_css.css" rel="stylesheet" type="text/css"/>

instead of: <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" />

Thank you in advance !

Christos Armpouniotis

www.kosmosnet.gr

Title: Re: Create new template
Post by: Ivan Trebješanin on July 24, 2008, 23:54:02
Hi armpouniotis,

About using tables:
Tables are not forbidden, though they ARE depreciated. The whole web is moving in div's direction (separate content from layout), so should you.  It's not 1998. anymore ;)

About style sheets:
You can use single stylesheet, but it is much better to separate layout from the content. Read previous thought about tables.

Regarding relative paths:
Yes, you could, but it is better to use $mainframe->getTemplate(); because you can use the same header section  for any other template, just copy/paste. Read the line about tables again.  ;)
Title: Re: Create new template
Post by: armpouniotis on July 25, 2008, 00:05:27
Hi there !

thank you for your quick reply !

I am asking about tables, because in the new template i made using elxis 2008 the table is not aligned in the center !!!
But, the same template is shown perfectly in 2006 !!!!

I am just wondering why is this happening !?!??!?!

Christos Armpouniotis

Title: Re: Create new template
Post by: Ivan Trebješanin on July 25, 2008, 00:10:35
I am asking about tables, because in the new template i made using elxis 2008 the table is not aligned in the center !!!

Have you tried creating surrounding div like this:

....
<body>
<div align="center">
..... YourTableBasedTemplate ....
</div>
</body>
Title: Re: Create new template
Post by: datahell on July 25, 2008, 08:44:59
Here is a quick and easy way to center anything with CSS.

Lets say we want to center the div bellow.
<div class="c">
    blah blah blah
</div>

In your CSS you should write:
div.c { margin: 0 auto; }

....and don't use tables!
Title: Re: Create new template
Post by: Farhad Sakhaei on July 25, 2008, 08:58:40
John , Could you please explain for us some css styling to use DIVs ? I am already have some of them , but I think that should use more hacks and technics to use DIVs !  :-[ Thank you
Title: Re: Create new template
Post by: datahell on July 25, 2008, 09:18:14
I can not teach you from here as I would have to write a whole book to answer you. One of my business tasks is giving CSS seminars but this can not be done from the web. If you can go to a CSS seminar near your place you will learn many things in a few hours. There are many and really good CSS guides, free layouts, menus, css reference lists on the web that you can study and learn. I spent many hours each day reading such things, you could do the same. Here are some important things you should know:

- Basic CSS syntax
- The box model (margin, padding, border)
- Floats and positioning
- Faux columns

CSS is extremely powerful if you learn how to use it. Tables are like dinosaurs, they have been vanished. And not just tables, the usage of html attributes to style anything is almost deprecated. You can do the same things better and faster with CSS.

If you wish to ask something more specific regarding CSS please go ahead. If you think this is difficult you will be lost when you see CSS 3 (now we use CSS1 and 2 with the exception of the "opacity" which belongs to CSS 3)! So, prepare your self!

I and Dejan Viduka have written a complete Elxis templates guide (e-book) that will be released soon for free. But learing CSS is something else and a pre-requirement to read and understand an Elxis template guide.

The same thing happens with PHP, it gets continuously updated. PHP 4 is history and Elxis 2008.1 is coded completely under PHP5. The web technology is moving fast (see IP V6). You can not learn everything but you can try stay up-to-date in a subject of your interest. It is not too hard if you try.
Title: Re: Create new template
Post by: Farhad Sakhaei on July 25, 2008, 10:11:23
I am already read many e-books about CSS styling , and tried to implement advanced layouts , But I have some small problem with DIVs that they are most in IE 6 ...
The first matter that I didn't start to use DIVs is that I couldn't implement a full stable layout , that it be a stable design in any contents ...

Here I attached a sample of my exercise with some hacks and ...
The problem is in IE-6 , When we resize the IE window ... and when we assign different content ... DIVs are not stable with any contents  ???


[attachment deleted by admin]
Title: Re: Create new template
Post by: xmanhattan on July 25, 2008, 10:57:02

I thought that I might throw in my 2 cents and say that I found reading this discussion interesting.

Quote
I and Dejan Viduka have written a complete Elxis templates guide (e-book) that will be released soon for free. But learing CSS is something else and a pre-requirement to read and understand an Elxis template guide.

As I am currently preparing 2 of my own sites in elxis, I would be very interested in the css manual that you mention.  I have made some changes to the okto template but I am not satisfied as yet and it is because I have to analyze the css in pieces as they apply to the whole.

Anyway, keep up the great job.

Petros
Title: Re: Create new template
Post by: rentasite on July 25, 2008, 11:40:47
There are many and really good CSS guides

Can you suggest any good book you know, plz?
Title: Re: Create new template
Post by: kebic on July 25, 2008, 13:01:42
Hack for IE and Safari


/* logo */
.logo {
float:left;
background: url('../images/logo.gif') no-repeat;
margin-left: 0px;
margin-top: 48px;
height: 151px;
width:585px;
border: 0px solid blue
}

/* IE5-6-7 Only */
* html .logo {
margin-right: 20px;
margin-top: 20px;
}

/* Apple Safari*/
html[xmlns*=""] body:last-child  .logo{
   padding-left: 0px;
        padding-right: 0px;
}
Title: Re: Create new template
Post by: armpouniotis on July 25, 2008, 13:02:59
Hi all !

i think i have found the solution for the tables:

At the header of the index.php file I deleted this row:

<?php mosShowHead(); ?>

and i inserted:

<title><?php echo $mosConfig_sitename; ?></title>

Now, I can use tables aligned in the center. It works in Firefox and IE 7

Regards

Christos Armpouniotis

www.kosmosnet.gr
Title: Re: Create new template
Post by: datahell on July 25, 2008, 14:02:46
If you don't use this: <?php mosShowHead(); ?> you don't have Elxis headers, you dont have automatic page titles, keywords and description, you dont have elxis javascript loaded, you dont have elxis standard css, you dont have elxis ajax support, etc. Big mistake!
Title: Re: Create new template
Post by: armpouniotis on July 25, 2008, 14:22:23
Yes ! Exactly !

But I need to find a solution of using tables in 2008.

I am just wondering why <?php mosShowHead(); ?> doesn't allow me to use properly tables.....
Title: Re: Create new template
Post by: Farhad Sakhaei on July 25, 2008, 14:24:50
You can see my table version of cytherea and gaia templates in elxis-downloads , they used Tables ...
Title: Re: Create new template
Post by: armpouniotis on July 25, 2008, 14:28:16
Actually,

the real problem about using tables in 2008 is that:

tables are not aligned using Firefox, but they are aligned using IE7....

I don't know why, but this happens only when i am putting in the header <?php mosShowHead(); ?>

I can't really explain it...

Title: Re: Create new template
Post by: Farhad Sakhaei on July 25, 2008, 14:33:02
NO ! See my templates : userlistings/farhad.html
Title: Re: Create new template
Post by: armpouniotis on July 25, 2008, 14:39:25
Interesting.....

Let me check it further. It seems you have found a solution to my problem.

Since i had this problem, I was about to change back to elxis 2006....

Thanx mate !

Title: Re: Create new template
Post by: Farhad Sakhaei on July 25, 2008, 14:41:34
John , Could you please check my practice and mention my faults? Thank You :)
Title: Re: Create new template
Post by: datahell on July 25, 2008, 14:44:32
What is the problem you have with tables?

If you want to align a table in the center you can use something like this:

<div align="center">
     <table>....</table>
</div>

or

<div style="text-align: center;">
     <table style="text-align: left;">....</table>
</div>

Yes farhad I already did it but your example is unreal, as I dont think that someone would create a template with that structure. To make things better first of all make sure that everything has margin, padding and border 0.

div {
margin: 0;
padding:  0;
border: 0;
}

Afterwards, especially for IE6, make one of the three columns a little bit more narrow (i.e instead of 20%, make it 19.9%).

<!-- [if lt IE6]>
<style type="text/css">
#right { width: 19.9%; }
#conright { width: 9.9%; }
</style>
<![endif] -->

You also have more css that the one needed. And the floats could be the opposite. If you formatted the html differently the final result would be better.
Title: Re: Create new template
Post by: Farhad Sakhaei on July 25, 2008, 14:46:05
What is the problem you have with tables?

If you want to align a table in the center you can use something like this:

<div align="center">
     <table>....</table>
</div>

or

<div style="text-align: center;">
     <table style="text-align: left;">....</table>
</div>

I mentioned about this post : https://forum.elxis.org/index.php?topic=2346.msg13950#msg13950 ;)
Title: Re: Create new template
Post by: datahell on July 29, 2008, 15:32:48
Elxis templates guide just released! you can download it for free:
documentation/e-books/elxis-templates-guide.html
Title: Re: Create new template
Post by: Farhad Sakhaei on July 30, 2008, 08:27:12
Thank you John and Dejan ;)