Closed (fixed)
Project:
Advanced Forum More Styles
Version:
6.x-6.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Aug 2009 at 15:17 UTC
Updated:
13 Jul 2010 at 22:10 UTC
Here's the code you need to support AF 2.x. Just add it to your .module file:
function advanced_forum_more_styles_ctools_plugin_directory($module, $plugin) {
if ($module == 'advanced_forum') {
return 'styles';
}
}
If you decide you want to put 2.x styles in a different directory, just change the return 'styles'; line to have the name of the new directory.
You can mix 1.x and 2.x styles in the same directory and it will work. 2.x will just pick up the ones with .info files. But it may be confusing to your users to have files in there that don't show up in the list.
Michelle
Comments
Comment #1
xarbot commentedHello:
This code must be in the advanced_forum_more_styles.module ? I'm using advanced_forum 6.x-2.0-alpha1
Thanks in advanced
Comment #2
michelleThat's what it's intended for, yes. AFAIK, he hasn't committed it yet.
Michelle
Comment #3
Netbuddy commentedSo what exactly should be in the module file?
I cant get minimal to come up in the dropdown box. This is what was in the module file:
<?php
// $Id: advanced_forum_more_styles.module,v 1.1 2009/07/15 00:55:48 eigentor Exp $
function advanced_forum_more_styles_advforum_styles() {
$items = array();
$items['minimal'] = array(
'directory' => 'styles/minimal',
);
return $items;
}
Do I (add)
function advanced_forum_more_styles_ctools_plugin_directory($module, $plugin) {
if ($module == 'advanced_forum') {
return 'styles';
}
}
or do I replace the original code?
Either way doesnt seem to work.
Comment #4
michelleIt needs to be added to the module file, not replace what's there, or 1.x styles will no longer work.
This code is to make AFMS work with 2.x styles. It's not going to magically turn a 1.x style into a 2.x style. :)
Michelle
Comment #5
eigentor commentedWell the upgrade to 2.x takes a bit more than changing the hook. The template files need to be renamed and some other stuff. I got my style working in the 2.x version, but in the end did not like the design anymore...
@Netbuddy: it is not that hard to do. Just look into a 2.x style and see all the changes, apply them to your 1.x theme, read the manual... http://drupal.org/node/512116
It is about an hour work if you are used to this kind of stuff.
Comment #6
eigentor commentedFinally a release compatible with Advanced Forum 2.x is available.
http://drupal.org/node/840932