Jump to content

For version 2.1 - new layout file


Nabeel

Recommended Posts

  • Administrators

I've implemented an additional layout format for 2.1, called 'layout.tpl'. When this file is in a skin's folder, it will use that, instead of the header.tpl and footer.tpl files. It'll look like this:

<html>
<head>
<title><?php echo $page_title ?></title>
<?php echo $page_htmlhead; ?>
</head>
<body>
<?php $page_htmlreq; ?>
<div id="container">
<div id="content">
<?php echo $page_content; ?>
</div>
</div>
</body>
</html>

As you can see, this is the entire HTML page, with:

<?php echo $page_content;?>

Placed where the content will show up, and the normal additions to the template.

The default skin has been changed to this. But it might help some people with skinning, since it's a bit easier to visualize how it comes together. The old method (header.tpl/footer.tpl) will still work, but if it sees the 'layout.tpl' file, it will use that.

Any other ideas?

Link to comment
Share on other sites

Looks like a great idea for people who are new to the whole skinning thing. I would still use header/footer myself as it seems to be that slight bit easier if you want to use columned layouts etc.

Actually never mind. Didn't think about it properly.

Looks fun.

Link to comment
Share on other sites

  • Administrators

Looks like a great idea for people who are new to the whole skinning thing. I would still use header/footer myself as it seems to be that slight bit easier if you want to use columned layouts etc.

Actually never mind. Didn't think about it properly.

Looks fun.

Yeah, it's just the header.tpl/footer.tpl squashed into one file.

Link to comment
Share on other sites

I've implemented an additional layout format for 2.1, called 'layout.tpl'. When this file is in a skin's folder, it will use that, instead of the header.tpl and footer.tpl files. It'll look like this:

<html>
<head>
<title><?php echo $page_title ?></title>
<?php echo $page_htmlhead; ?>
</head>
<body>
<?php $page_htmlreq; ?>
<div id="container">
<div id="content">
<?php echo $page_content; ?>
</div>
</div>
</body>
</html>

As you can see, this is the entire HTML page, with:

<?php echo $page_content;?>

Placed where the content will show up, and the normal additions to the template.

The default skin has been changed to this. But it might help some people with skinning, since it's a bit easier to visualize how it comes together. The old method (header.tpl/footer.tpl) will still work, but if it sees the 'layout.tpl' file, it will use that.

Any other ideas?

LGTM

Link to comment
Share on other sites

Guest N402KC

Well on the current version, i had to make links for all my images. (<?php ECHO SITE_URL ?>/lib/skins/simual/images/logo.jpg) in order for them to work. On the new version will we have to do thaT?

Link to comment
Share on other sites

  • Administrators

Since 2.0 (the last release) there's been these functions:

url('module/etc/...'); // Same as index.php/site/etc/...
actionurl('module/etc/...'); // same as action.php/site/etc/...
fileurl('lib/skins/etc/'); // same as site_url/lib/skins

It automatically adds in the SITE_URL, et. It was detailed in the changelo/upgrade guide

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...