Joomla 1.6 components not styled


Author Message
Joachim

Posted: 2/24/2011
Quote message 

Hello,

I'm using Artisteer 3.0 for creating a template for Joomla 1.6.

The problem is, that componets do not get the style of the normal articles: different font, different heading, different margin...

I tried those components: Weblinks (already included in Joomla), dfcontact and phocagallery.

Perhaps someone knows a solution to this issue, willing to share.

thanks, Joachim

 
Joachim

Posted: 2/25/2011
Quote message 

I just found out, that templates createt with Artisteer version 2.6.0.36391
do not have the problem of components having not the same style as articles.

I would be lucky, if anyone knows a solution for Artisteer 3.0

thanks, Joachim
 
Joachim

Posted: 2/25/2011
Quote message 

Here is the solution to the problem mentioned in my first post.

In functions.php we have 2 classes: ArtxPage15 and ArtxPage16.

In ArtxPage15 there is the function componentWrapper():

// Wraps component content into article style unless it is not wrapped already.
function componentWrapper()
{
if ($this->page->getType() != 'html')
return;
$content = $this->page->getBuffer('component');
if (false === strpos($content, '<div class="pp-post')) {
$title = null;
if (preg_match('~<div\s+class="(componentheading[^"]*)"([^>]*)>([^<]+)</div>~', $content, $matches, PREG_OFFSET_CAPTURE)) {
$content = substr($content, 0, $matches[0][1]) . substr($content, $matches[0][1] + strlen($matches[0][0]));
$title = '<span class="' . $matches[1][0] . '"' . $matches[2][0] . '>' . $matches[3][0] . '</span>';
}
$this->page->setBuffer(artxPost(array('header-text' => $title, 'content' => $content)), 'component');
}
}


I added this function to the class ArtxPage16 and it works as far as I can say.

I hope this helps others as well.
Joachim
 
Nick

Posted: 4/5/2013
Quote message 

Do you know how to do this with Artisteer 3.1 adn Joomla 2.5?