By sinker on
I'm in the process of moving my site from Joomla to Drupal and while Drupal has been a dream on the content end, I keep getting frustrated on the design end of things. With Joomla, I was able to designate all the placement of elements, widths, etc... via CSS and create a VERY simple and very lean php file for the actual index page:
<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?>
<!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; ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<?php mosShowHead(); ?>
<script type="text/javascript"> </script> <!--http://www.bluerobot.com/web/css/fouc.asp-->
<style type="text/css">
<!--
@import url(templates/PP_template/css/template_css.css);
@import url(templates/PP_template/css/position_css.css);
-->
</style>
</head>
<body>
<div id="top-section">
<div id="top-col-1">
<img src="templates/PP_template/images/pp_title.gif">
<div id="top-col-2">
<?php mosLoadModules('top');?>
</div>
</div>
</div>
<div id="wrappin">
<div id="mid-section">
<div id="maincontent">
<?php mosMainBody(); ?>
</div>
<div id="rightmenu">
<?php mosLoadModules('right');?>
</div>
<div id="leftmenu">
<?php mosLoadModules('left');?>
</div>
</div>
<div id="bottom-section">
<div id="bottom">
<?php mosLoadModules('bottom');?>
<?php include_once('includes/footer.php'); ?>
</div>
</div>
</div>
</body>
</html>With Drupal, I have not been able to find a way to simply and easily separate the layout from the php. Am I thinking about this the wrong way?
Thanks!
Comments
sort of OT: why'd you migrate?
sorry this is OT relative to your question, but why did you migrate from Joomla? (I ask because I tried Mambo back in the day and found it too confounding. Drupal often makes my brain a little sore too, but I am using it nonetheless)
sorry for the delay in getting back
Hey, great question! Sorry, but I've been so busy on the site that I haven't had a chance to get back to you on this.
I worked with Joomla for a number of months trying to get the functionality that Drupal had RIGHT OUT OF THE BOX. I can't even express the frustration (and relief) I felt when, after four months of wrestling with Joomla to get things like user blogs & profiles functional, I had all of the basic functionality operational in about 45 minutes of working with Drupal.
Basically, Joomla was the wrong tool for the community-based site that I am making. I can see how it's very powerful, and there are some features that I dearly miss (like being able to assign specific templates to specific pages), but all in all things with Drupal have been SO MUCH BETTER.
Hope you're enjoying it too.
Drupal Tricky But Good
I've only ever used Drupal, and not for long, either, so I'm not familiar with Joomla's method of displaying content (and keeping structure and content seperate). While I do appreciate the way PHPtemplate works, I love the simplicity of Joomla's way! In fact, that was the way I was hoping the CMS I ultimately chose would be... I build an HTML template and insert pointers or inserts to the CMS-generated content. Anyway, you'll want to read up on PHPtemplate. I wouldn't say PHPtemplate is "easy," but it is comprehensive and flexible enough to get anything you want done.
For example, my own (and first) Drupal-generated web site can be seen at http://www.momsmedicinechest.com/. It's all CSS, with liberal use of custom blocks, a customized page.tpl.php, and the views module.
yes- this is certainly possible
See, for example:
http://drupal.org/node/66150
http://drupal.org/project/interlaced
http://www.blkmtn.org/node/336
http://www.nicklewis.org/node/850
http://webschuur.com/node/633
You should essentially be able to use the same page template as above if you're good with CSS. phptemplate has some standard naming conventions for the regions, so you may wnat ot convert to those to simplfy your life:
http://drupal.org/node/509
---
Work: BioRAFT
You can do it!
Hi Sinker
You can do it with nice simple code and separate CSS for all layout.
If you have a look at a theme like bluemarine, the two main files you need to look at are pagetpl.php and style.css. I just made copies and started experimenting.
page.tpl.php is the file that corresponds to what you have listed above. In the case of bluemarine, the page is set out using tables, and there are a few more bits of php in it, but essentially, it is organised into the top, left, right, main and bottom sections that you want. To figure exactly what was happening, I found it useful to add some annotation like start of left section, end of main content, and so on. If you define the div's in the style.css file, you can strip out the tables and end up with the kind of structure you have shown.
Digging a bit deeper, you may also want to look at node.tpl.php, which defines the way a node or chunk of content is presented. There is also a file somehere called drupal.css. This contans all kinds of styling information that you may or may not like. In my case, I dug around looking at the source code in the browser to see what was going on, and redefined any styles I didn't like in my style.css file.
I think the php is also a bit more complicated than your example, because, by default, page.tpl.php is driving all the pages on the site, including the admin pages. If you want a really lean page for your index page, you could make the front page with different php, and cut out a lot of the options.
I hope this helps. It really is possible!
thanks to everyone
Thanks to all who helped out on this question. Once I was able to let go of some of the niceties of Joomla's templating system, I TOTALLY understand the power of phptemplate and have hacked up the holygrail CSS, and a bit of the template itself, into something totally different. I really couldn't be happier.