A simple, working easy to implement suffix for modules


Author Message
Amrit

Posted: 10/14/2010
Quote message 

First, I tried all solutions here, but to no use.
Just got confused, mostly because I have the 2.5 version and the code differs from the examples.

Also, most of the examples was rather messy to implement IMHO.

So I just changed the code where it made most sense to change it. NO idea if it is "the way to go" or not, but it is working properly and SHOULD work on ANY installation.

In modules.php, go to the function called modChrome_artnostyle, and there will be a row something like this:
<div class="art-nostyle<?php echo $params->get('artx-module-classes'); ?>">


If you read that line, it is easy to see what it is doing. It simply gets the params of artx-module-classes, which doesn't work. Don't even know why it's there, because it really isn't needed AFAIK...

Now you can go about this in alteast two ways:
1: Throw a wrapper div around the whole block like this:
function modChrome_artnostyle($module, &$params, &$attribs) { if (!empty ($module->content)) : ?> <?php echo '<div class="'.$params->get('moduleclass_sfx').'">'; ?> <div class="art-nostyle<?php echo $params->get('artx-module-classes'); ?>"> <?php if ($module->showtitle != 0) : ?> <h3><?php echo $module->title; ?></h3> <?php endif; ?> <?php echo $module->content; ?> </div> </div> <?php endif; }


or the second option would be to just replace the non-working part of the code, so you replace
<?php echo $params->get('artx-module-classes'); ?>

with joomlas native way of getting the suffix which is:

<?php echo $params->get('moduleclass_sfx'); ?>


And now you have your suffixes working properly again.

I have no clue why Artisteer Crew just haven't pasted in the above code, since it just is plain joomla syntax.

Am I missing something?
(I'm just a happy amateur so what do I know... ;)

And ooh, do save these settings in the C:\Program Files (x86)\Artisteer 2\Library\Data\Templates\Joomla\Export\Files\html\module.php file, so it will be correct every time you export a Joomla template.

Cheers
Amrit
 
Brunna

Posted: 10/20/2010
Quote message 

Hello

And about the use? css etc... please explain... i try a long time too read and try all posts with no success...
 
ARS Web Development

Posted: 10/22/2010
Quote message 

I have also been plagued with this issue, as much as I love artisteer. I have a solution that is much simpler and bypasses the artxblock function because it saves a TON of headache.
I am not 100% but from what it appears to me that artxblock function is dynamically generated by the software depending on what styling you choose for the template modules. no one specific solution will apply to all, from my best observation that is.

The artxblock function creates all of the divs for the corner styling, this that blah blah. its a lot of fluff with two main content parts: module->title and module->content.

The modules.php file is the one that routes each module call to the appropriate function. In the top section, function modchrome_artstyle sets the style in an array, then calls the appropriate function according to the style. the trick is to simply add a new style into that array, and a new function below this.
The original styles array is the following:

$styles = array(     

'art-nostyle' => 'modChrome_artnostyle',
'art-block' => 'modChrome_artblock',
'art-article' => 'modChrome_artarticle',
'art-vmenu' => 'modChrome_artvmenu', );


If you add something in there, say:

'arswd-block' => 'modChrome_arsblock'


this will create a new style in the array, and call the appropriate function below when your chrome is selected. Here is a basic example of a chrome that i use for that type above:

function modChrome_arsblock($module, &$params, &$attribs) {
if (!empty ($module->content))
?>
<div class="ars-block">
<div class="ars-block-title">
<?php if ($module->showtitle != 0) : ?>
<h3><?php echo $module->title; ?></h3>
<?php endif; ?>
<div class="ars-block-body">
<?php echo $module->content; ?>
</div> </div> </div>
<?php }


either add to or create a new css file to go along.
 
ARS Web Development

Posted: 10/22/2010
Quote message 

another reason to bypass the artxblock function is that there are so many divs that make it come together and a lot of them have !important tags on them, its frustrating to have to override all of these styles with your own. if you create your own chrome you can bypass all of the artisteer generated segments and keep it simple to save time.
 
Garry

Posted: 11/11/2010
Quote message 

Artisteer 3.0 preview version support custom module class suffixes out of the box.
 
Dave Bishop

Posted: 2/15/2011
Quote message 

Thanks Gary,

I am looking forward to customizing the mod class suffixes. I have wanted this the whole time. As a basic CSS level person I am hoping there will be some documentation on this new feature in 3.0. Will there be a new user manual for 3.0 and if so how soon after the stable release.

Thanks!
 
Conny Roukens

Posted: 11/17/2011
Quote message 

Quote Garry:

Artisteer 3.0 preview version support custom module class suffixes out of the box.

I'm using Artisteer 3.1.0.45075 en Joomla 7.2. I tried for a long time to get the css options to work, but they won't. Can you please give me an example how to work with the css options. I just want to make a module with a red backgroud. Please help.
 
Garry

Posted: 11/17/2011
Quote message 

Last link from following documentation page may be very helpful: http://www.artisteer.com/?p=help_joomla