I needed this for drupal 6 so I've updated it and attached my version to this post (not really sure if that's be right way to submit it). No longer need to add anything to the template.php file either, it's all taken care of in the module.

Hope someone finds it useful.

-Tony.

CommentFileSizeAuthor
#4 blocktheme-6.x-0.4.zip8.39 KBatomicus.org
#3 blocktheme-6.x-0.3.tar_.gz7.53 KBAnonymous (not verified)
#3 blocktheme-6.x-update.patch24.18 KBAnonymous (not verified)
blocktheme-6.x-0.1.tar_.gz7.58 KBdrasgardian

Comments

aMakUzr’s picture

Title: update for drupal 6 » Update for Drupal 6
Component: Code » Miscellaneous
Assigned: Unassigned » aMakUzr
Priority: Normal » Minor
Status: Active » Fixed

For anyone who's interested, blocktheme-6.x-0.1.tar_.gz works for the nice Tapestry theme (http://demo.roopletheme.com/) in Drupal 6.1.

Until the Tapestry download is properly updated, I posted instructions at
http://www.roopletheme.com/forum/index.php?topic=535.0
on how to get it all working.

Much thanks, Tony ... it is useful and appreciated.

Anonymous’s picture

Component: Miscellaneous » Code
Assigned: aMakUzr » Unassigned
Category: feature » task
Status: Fixed » Needs review

@drasgardian (Tony)
Thanks for posting this update. Somehow I didn't see this page until today.
Because I also made a 6.x update, I sent an e-mail to Jacob Singh, the developer of this module, asking him what to do next.
He asked me to post patches for the module here, but if I did that now, it would be very confusing, having you version as well.
So I won't. Instead I will review you version today or tomorrow and comment on it on this site. (I saw there is a small issue with blocktheme_help). When we (and any other reviewer) agree, we can post the patch files and Jacob can create a 6.x branche in the drupal repository with a development version, so the community can do beta testing. When no more serious issues arise, we can remove the beta status. Mind you, the whole process doesn't have to take more than a week or two.

Gertjan

Anonymous’s picture

StatusFileSize
new24.18 KB
new7.53 KB

I just reviewed the 6.x-0.1 version

I really like the added functionality to set the block theme right away when the block is created

Besides this, I found a few minor issues (see below)

function blocktheme_menu:

  • The $may_cache parameter is not used anymore in Drupal 6.x, so I removed it as well as the now unnecessary if {} block.
  • Added 'access arguments' => array('administer access control') to make sure the menu item is visible in the admin/settings menu.

function blocktheme_help:

  • Changed the $section parameter to the new Drupal 6.x parameters $path and $arg.
  • Removed the unnecessary global $base_path

function blocktheme_preprocess_block:

  • Removed the unnecessary module_exists('blocktheme') from the if statement

end of file:

  • Removed the ?> end tag according to Drupal coding standards

Apart from these issues, I added two features of my own:

  • 1. I like the blocktheme- prefix for the template files, but it can be a lot of work to change this in all existing blocks.
    Therefore I changed the code to add the blocktheme- prefix to the template file reference.
    If the theme name allready starts with blocktheme- this prefix is removed first.
  • I added a template variable $blocktheme which value is the name of the block theme name without a blocktheme- prefix.
    This variable can be used to change template file behavior according to the block theme instead of creating a seperate template file for each block theme.

Attachments:

  • new version 6.x-0.3 with my updates
  • patch from 5.x-1.2 to 6.x-0.3

-

atomicus.org’s picture

StatusFileSize
new8.39 KB

Based on the work done on the previous post (6.x-0.3), I tried to install and configure the module on Drupal 6.2 and I have had no success in accessing the admin/settings/blocktheme page (Access denied).

With little drupal coding experience I noticed that the function creating the admin menu entry was not the same as the other modules, therefore I added the callback in bold, in file blocktheme.module.

function blocktheme_menu() {
  $items['admin/settings/blocktheme'] = array (
    'title' => t('Block Theme'),
    'description' => t('Allows the admin to define re-usable block templates that can be configured from block config screen'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('blocktheme_admin_settings'),
    'access callback' => 'user_access',
    'access arguments' => array('administer site configuration')
  );
  return $items;
}

I just added the line
'access callback' => 'user_access',
Now it works, showing the admin menu entry and allowing blocktheme module configuration under D6.2. Also works ok in showing the defined block styles in my theme.
Sorry, don't knw how to tar therefore I attached the .zip of a renamed 0.4 version.
regards

terryallan’s picture

Thanks to all above and especially to aMakuzr and atomicus.org I have now managed to put myself into the situation as described by atomicus. ie "Now it works, showing the admin menu entry and allowing blocktheme module configuration under D6.2. Also works ok in showing the defined block styles in my theme."

Unfortunately when I choose one of the block themes it is not applied when I save the changes. Has anyone any ideas?

To clarify this post I would like to add the following.

I can see all that is necessary to make changes. All the block styles appear in the drop down menu. However, when I select on of these styles for a selected block and save appropriately, the change is not made. It is as though nothing has been selected.

As far as I am aware I have installed all the resources and updates, as suggested by aMakuzr and atomicus.org.

Clearly I have omitted something if others have succeeded.

Terry

Anonymous’s picture

Hi Terry,

I'm trying to figure out what goes wrong in your case. Could you answer the following questions:

  • In your comment you say: the change is not made. It is as though nothing has been selected. Does this also mean that the right template doesn't get selected, or just that your selection doesn't show when you re-open the block editor?
  • What is the exact content of the custum block template field in your Block Theme settings? You have to make sure you don't have any spaces or other special characters before the | symbol.

Gertjan

terryallan’s picture

Thanks Gertjan

In the custom block template field I have:

blk-nomargins.tpl.php|no margins
blk-outline3.tpl.php|outline 3
blk-outline4.tpl.php|outline 4
blk-rollover2.tpl.php|rollover 2
blk-outline1.tpl.php|outline 1
blk-solid1.tpl.php|solid 1
blk-outline2.tpl.php|outline 2
blk-rollover1.tpl.php|rollover 2
blk-solid2.tpl.php|solid 2
blk-solid3.tpl.php|solid 3
blk-solid4.tpl.php|solid 4
color0-pagebg.tpl.php|color 0
color3-pagebg.tpl.php|color 3
color4-pagebg.tpl.php|color 4
color1-pagebg.tpl.php|color 1
color2-pagebg.tpl.php|color 2
color5-pagebg.tpl.php|color 5
stripe0-pagebg.tpl.php|strip 0
stripe1-pagebg.tpl.php|stripe 1
stripe3-pagebg.tpl.php|stripe 3
stripe4-pagebg.tpl.php|stripe 4
stripe2-pagebg.tpl.php|stripe 2

The templates do show and I can select a template but it has no effect.

There is no Theme Settings API module installed but I believe that this is not necessary in Drupal 6. Is that correct?

Much appreciated

Terry

Anonymous’s picture

Assigned: Unassigned »

Hi Terry,

When the Blocktheme template 'searches for template files', it appends the .tpl.php suffix to your theme name.
In your case it will search for blk-nomargins.tpl.php.tpl.php, and not for blk-nomargins.tpl.php as I assume you expect.
Please remove the .tpl.php suffixes from your settings and let us know if this solves your issue.
Also if you have a suggestion to improve the instructions, please let us know.

Gertjan

drasgardian’s picture

I've only just come back to check this after my first post. Thanks everyone (and especially g.idema, I like and agree with the additions you've made) for running with it. I've checked out the 6.x-0.4 version and it seems to be working well. Is Jacob Singh watching this? It would be good to progress this to an official 6.x release.

terryallan’s picture

Thanks Gertjan

I didn't have the .tpl.php suffixes originally and I added them because it wasn't working for me. I have since reverted to what you suggested and it still isn't working. Sorry! It is probably another issue with the site. If you have any other suggestions I am happy to try them.

I have, however, now given up on Drupal version 6 for the latest site I am producing and I have installed a version 5.7. All the modules I require are there and Tapestry works a treat and OG with Panels adds functionality. I will re-visit version 6 in a few months time once all the modules I require are ready.

Much appreciated.

Terry

JacobSingh’s picture

Hi Guys,

I am watching this, but don't have a 6.x project to test it on right now and am too busy to test it otherwise.

When we get a couple people reviewing it successfully, I'll take a look and commit it.

Thanks!
-J

hkcert’s picture

I have used blocktheme-6.x-0.4.zip and copy the following files in tapestry on drupal 6.2, and i can access & setting the blocktheme. However, nothing has changed on my layout?

blk-nomargins.tpl.php
blk-outline3.tpl.php
blk-outline4.tpl.php
blk-rollover2.tpl.php
blk-outline1.tpl.php
blk-solid1.tpl.php
blk-outline2.tpl.php
blk-rollover1.tpl.php
blk-solid2.tpl.php
blk-solid3.tpl.php
blk-solid4.tpl.php
color0-pagebg.tpl.php
color3-pagebg.tpl.php
color4-pagebg.tpl.php
color1-pagebg.tpl.php
color2-pagebg.tpl.php
color5-pagebg.tpl.php
stripe0-pagebg.tpl.php
stripe1-pagebg.tpl.php
stripe3-pagebg.tpl.php
stripe4-pagebg.tpl.php
stripe2-pagebg.tpl.php

~
Do I miss some important step?

Anonymous’s picture

Hi hkcert,

I guess you missed something. Question is what? For what I read in your post, it looks like you did everything necessary to get it working, but your results show otherwise, so let's go to the questions/check-list.

  1. Did you use Blochtheme before in an older Drupal version, or is this the first time you use it?
  2. Did you try an other theme, or just Tapestry?
  3. Did you have the correct format in your Blocktheme settings? It should look like this:
    blk-nomargins|Your nomargins description
    blk-outline3|Your outline3 description
    blk-outline4|Your outline4 description
  4. Did you put the template files in the themes/tapestry folder?
    1. If I find time, I'll have a look at the tapestry/blocktheme combination to see if there is an issue.

Anonymous’s picture

Please forget my previous post.

The step you missed is to prefix your template files with blocktheme-.
Please let me know if you think the documentation needs improvement.

Gertjan

hkcert’s picture

you mean I need to add some codes in "template.php"?

Is it the following code?

function tapestry_block($block) {
if (module_exists('blocktheme')) {
if ( $custom_theme = blocktheme_get_theme($block) ) {
return _phptemplate_callback($custom_theme,array('block' => $block));
}
}
return phptemplate_block($block);
}

Anonymous’s picture

No, that's not what I meant. You don't have to put anything into "template.php". This was only necessary for Drupal 5.

What I meant is, you have to rename your templates as follows:

blk-nomargins.tpl.php -> blocktheme-blk-nomargins.tpl.php
blk-outline3.tpl.php -> blocktheme-blk-outline3.tpl.php
etc..

This change was made in the Drupal 6 version of Blocktheme to prevent name conflicts in a uniform way.

If this works, you could consider a little cleanup by removing the "blk-" part of both your blocktheme settings and template files:

Your settings will become:

nomargins|no margins
outline3|outline 3
etc ..

And your template files:

blocktheme-nomargins.tpl.php
blocktheme-outline3.tpl.php

edward.peters’s picture

Just want to say THANK YOU to all who have ported this module. It is absolutely brilliant to have it for D6. Will someone be committing the code officially to the CVS, and advertising its availability on the project page?

editormp’s picture

I am using 5.7 and have not upgraded to 6 at all, and found this while looking atpossible issues when I do.

Note that I had the same problem when I installed the module (as a result of trying out the roople tapestry theme) and it didn't work. It took me a while to figure out that I was also adding the suffixes ("tpl.php"). Without actually looking at code, I considered the possibility and tried the alternative and it worked.

Perhaps the instructions could clearly indicated how to add the block themes to the list.

Note that I find the module is one of the most useful, especially to new users, because it provides a great ability to rearrange the look without knowing the code. Although I know how to program, I am basically a content provider.

hsolomon’s picture

I haven't had a look at the code yet but can blocktheme work for themes other than tapestry? Would we need to modify template.php in that case?

drasgardian’s picture

Yes, it will work for themes other than tapestry (I've never used tapestry). No you won't need to modify the template.php. Modifying the template.php was a requirement for the drupal 5.x version of this module and is no longer required for the drupal 6.x version.

JacobSingh’s picture

Hey guys,

I'd like to commit this, and if possible find a co-maintainer, (roople?) because it isn't really a priority for me.

So going forward, I either want:

a). drasgardian or Gertjan or whomever to come forward and be the maintainer of the 6.x branch and they can decide when to commit it

or

b). Get some users to test this till it is RTBC and I'll do my own quick tests on 6.x and commit it.

Thanks for keeping this little hack alive :)

Jacob

gazwal’s picture

hi, this module is very powerful for theme developper/designer
We are all waiting for an official D6 release
thanks for working on it
best regards
++

Anonymous’s picture

Hi Jacob,

I'm prepared to step forward as the maintainer of the 6.x branch.
As far as I can see, the latest issues were all support issues. I'll read them over once more, improve the documentation where necessary, and commit it as a dev version.

Gertjan

AntinOz’s picture

I have this running on my personal site (just converted to D6) at the moment and it appears to be working fine.

Ant

JacobSingh’s picture

Hi Gertjan,

Please apply for a CVS account on d.o. so I can authorize you.

Best,
J

Anonymous’s picture

Hi Jacob,

I just submitted my CVS account application.

Regards, Gertjan

AjK’s picture

Fyi, CVS application approved.

JacobSingh’s picture

Done.

Anonymous’s picture

Version: 5.x-1.2 » 6.x-1.0-beta1
Status: Needs review » Closed (fixed)

I released the 6.x version. And will close this issue.

edward.peters’s picture

The module seems to work very well. Are you planning a full release?

vidmarc’s picture

I've just installed "blocktheme-6.x-1.0-beta1" and I'm getting the following errors:

warning: Missing argument 2 for blocktheme_help() in /web/guide/site/public_html/modules/blocktheme/blocktheme.module on line 28.

warning: Missing argument 2 for blocktheme_help() in /web/guide/site/public_html/modules/blocktheme/blocktheme.module on line 28.

blocktheme does not appear in my admin/settings/