Drupal export issues and how to fix


Author Message
Ivan

Posted: 2/21/2009
Quote message 

I work a lot with Drupal over the last two years and found this software as brilliant. The only one problem is thempating implementation. I took me about 4 hours to add required staff and remove not required or one interfering with Drupal.

Let me give you small advise: Download Drupal 6 and have a look at garland theme or acquia theme. Actually copy the whole template into Artisteer and this will be a good start already. You don't really need to re-invent the wheel to get your software going.
For example, page.tpl.php file
$styles include all drupal styles and template styles. You do not need to include this file separately. This file should be specified in the .info file as this:

stylesheets[all][] = style.css
stylesheets[print][] = print.css
In your implementation this file (style.css) being loading twice.

By having this function in template.php file:

/**
* Sets the body-tag class attribute.
*
* Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
*/
function phptemplate_body_class($left, $right) {
if ($left != '' && $right != '') {
$class = 'sidebars';
}
else {
if ($left != '') {
$class = 'sidebar-left';
}
if ($right != '') {
$class = 'sidebar-right';
}
}

if (isset($class)) {
print ' class="'. $class .'"';
}
}

and having body in your page.tpl.php file like this:

<body<?php print phptemplate_body_class($left, $right); ?>> 


you can manipulate width of the main content area in case of one or two sidebars active. The point is if artisteer exports two sidebar layout and Drupal disable one of them because there's no single block active - the main content width is inaccurate.

----------------------------------------
I also found myself prefixing path_to_theme() function with base_path() (to become $base_path.path_to_theme()) as all template images failed to load. (because of no / in front of the source path).

<?php if (isset($tabs)): print $tabs.'<div class="cleared"></div>'; endif; ?> should be followed by
<?php if ($tabs2): print '<ul class="tabs secondary">'. $tabs2 .'</ul>'; endif; ?>
as secondary tabs have a lot of functionality which isn't available currently.

and finally - <?php print $closure; ?> should be positioned right before the </body> tag.


Also looking into node.tpl.php and the rest of box, block etc. files show that you are trying to build another theming layer on top of existing one.

For example,
<?php if ($links) { echo theme('links', $node->links, $attributes = array('class' => 'links'));} ?>

is an equivalent of the Drupal garland equivalent of
<?php if ($links): ?>

<div class="links"><?php print $links; ?></div>
<?php endif; ?>


$links is already available for your template - you don't need to reimplement links again.

I also have found few other re-implementations of existing theme variables.

So please change them accordingly to avoid your customers doing this job again and again.

Thank you for great software, though.
 
Caroline

Posted: 2/26/2009
Quote message 

Hello Ivan,

You seem to be a real expert in Drupal. Why don't you contact Artisteer support about all these issues? I'm sure they will be happy to improve their software.

I haven't analyzed all the issues you mentioned (I'm not that good in Drupal), but one of them looks quite strange to me.
I assume you are using Clean URLs feature, right? Why do you need to change:
base_path().path_to_theme()
to
$base_path.path_to_theme() code?

base_path() function seem to return the correct base url like
http://localhost:8081/drupal69/ (on my local machine)
why the $base_path contains the entire path like
http://localhost:8081/drupal69/admin
which is not needed.

Or did you maybe move the \themes\ThemeName\images\ folder to some other place?

Caroline.
 
Chad Dupuis

Posted: 3/17/2009
Quote message 

+1

Body resizing is a must for drupal, and other CMS users. The themes are useless within a dynamic CMS without the ability to accommodate for empty sidebars.

I've also noticed some problems in the exported themes with handling tables (forums and ubercart stores) in drupal. It seems that every theme I have downloaded makes the tables full width and drops the sidebar(s) below the content.

I'm still trying to figure out the CSS to fix this.

All in all a great product, just needs a little more flexibility built-in for drupal and I would imagine other CMS's as well.