Article Images not appearing in J!2.5 with Artisteer Templates


Author Message
Pete B.

Posted: 2/9/2012
Quote message 

One of the great new features of J2.5 is the article image that's been added. Unfortunately, I can't get them to display in an Artisteer generated template. They display fine when switched to a Joomla supplied default template. Artisteer support acknowledges the problem and says it should be fixed in a future update but can not give any date on when that may be, nor do they have any suggestions on how to work around this problem.

I'm using the 48375 latest build of Artisteer (1/31/12) and Joomla 2.5.1

Anyone have any sugestions? Is anyone able to get the article image newly defined in 2.5 to display with an Aritisteer, or modified Artisteer template?
 
Michael B.

Posted: 7/18/2012
Quote message 

I had the same problem, investigated a little bit and found a working solution. You have add some custom css to the template, export and then change 8 files in the template.

Here is the solution step by step:

-------------------------------------------------------------------------------------------------
1. open your template in Artisteer and add the following Additional CSS styles in Export Options:

/* ++++++++++++++ image float style ++++++++++++++ */
.img-fulltext-left {
float:left;
margin-right: 20px;
margin-bottom: 20px;
}

.img-intro-left {
float: left;
margin-right: 10px;
margin-bottom: 10px;
}

.img-fulltext-right {
float: right;
margin-left: 20px;
margin-bottom: 20px;
}

.img-intro-right {
float: right;
margin-left: 10px;
margin-bottom: 10px;
}


Save and export your template. Then go to the folder where you exported the template, and if you chose to create a ZIP archive unzip it.

-------------------------------------------------------------------------------------------------
2. Modify html\com_content\article\default.php:

On line 9 insert:

$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$url_text = '';
if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='0')) OR ($this->item->params->get('urls_position')=='0' AND empty($urls->urls_position) ))
OR (empty($urls->urls_position) AND (!$this->item->params->get('urls_position'))))
$url_text = $this->loadTemplate('links');


Change the next line to:
$article = $component->article('article', $this->item, $this->item->params, array('print' => $this->print, 'images' => $images, 'url_text' => $url_text));


-------------------------------------------------------------------------------------------------
3. Modify html\com_content\category\blog_item.php:

On line 9 insert:
$images = json_decode($this->item->images);


Change the next line to:
$article = $component->article('category', $this->item, $this->item->params, array('images' => $images));


-------------------------------------------------------------------------------------------------
4. Modify html\com_content\featured\default_item.php:

On line 5 insert:
$images = json_decode($this->item->images);


Change the next line to:
$article = $component->article('featured', $this->item, $this->item->params, array('images' => $images));


-------------------------------------------------------------------------------------------------
5. Modify classes\ArtxContent.php:

Change line 42 and line 45 to:
                                                      $article, $params, $properties);


-------------------------------------------------------------------------------------------------
6. Modify classes\ArtxContentCategoryArticle.php:

Change line 6-8 to:

function __construct($component, $componentParams, $article, $articleParams, $properties)
{
parent::__construct($component, $componentParams, $article, $articleParams, $properties);


-------------------------------------------------------------------------------------------------
7. Modify classes\ArtxContentFeaturedArticle.php:

Change line 6-8 to:

public function __construct($component, $componentParams, $article, $articleParams, $properties)
{
parent::__construct($component, $componentParams, $article, $articleParams, $properties);


-------------------------------------------------------------------------------------------------
8. Modify classes\ArtxContentSingleArticle.php:

On line 46 insert:

$images = $properties['images'];
$url_text = $properties['url_text'];
$image_fulltext = '';
if (isset($images->image_fulltext) and !empty($images->image_fulltext)) {
$imgfloat = (empty($images->float_fulltext)) ? $this->_articleParams->get('float_fulltext') : $images->float_fulltext;
$image_fulltext = "<div class=\"img-fulltext-" . htmlspecialchars($imgfloat) . "\">" . "<img ";
if ($images->image_fulltext_caption)
$image_fulltext .= 'class="caption"' . ' title="' . htmlspecialchars($images->image_fulltext_caption) . '"';
$image_fulltext .= ' src="' . htmlspecialchars($images->image_fulltext) . '" alt="' . htmlspecialchars($images->image_fulltext_alt) . '"/></div>';
}


Change the next line to:
        $this->text = ($this->_articleParams->get('access-view') ? $url_text . $image_fulltext . $this->_article->text : '');


-------------------------------------------------------------------------------------------------
9. Modify classes\ArtxContentListItem.php:

Change line 8 to:
    protected function __construct($component, $componentParams, $article, $articleParams, $properties)


On line 15 insert:

$images = $properties['images'];
$image_intro = '';
if (isset($images->image_intro) and !empty($images->image_intro)) {
$imgfloat = (empty($images->float_intro)) ? $this->_articleParams->get('float_intro') : $images->float_intro;
$image_intro = "<div class=\"img-intro-" . htmlspecialchars($imgfloat) . "\">" . "<img ";
if ($images->image_intro_caption)
$image_intro .= 'class="caption"' . ' title="' . htmlspecialchars($images->image_intro_caption) . '"';
$image_intro .= ' src="' . htmlspecialchars($images->image_intro) . '" alt="' . htmlspecialchars($images->image_intro_alt) . '"/></div>';
}


Change the next line to:
        $this->intro = $image_intro . $this->_article->introtext;


-------------------------------------------------------------------------------------------------
10. Create a ZIP archive from the template folder and install it on your Joomla web site.
 
Michael B.

Posted: 7/18/2012
Quote message 

By the way, this solution is for Artisteer v3.1.0 build 48375 Standard edition but may also work for other versions.
 
Garry

Posted: 7/19/2012
Quote message 

You can also get an internal update from Artisteer support having fix.
 
Edgar

Posted: 9/6/2012
Quote message 

This works flawlessly. Thanks a lot! ;-)
 
Dave B

Posted: 9/7/2012
Quote message 

Yes the newest version, 3.1.0.56360 works natively, no extra steps.
 
Ernesto Vargas

Posted: 4/11/2013
Quote message 

:-) Hi! Thanks a lot. Here is an example how to add a link to intro image. in a artisteer 2.5 template.

Modify classes\ArtxContentListItem.php:

On Line 18 or looking for "$image_intro = '';" and paste before:

/** add this */ echo "<a href=\"" . JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)) . "\">";


And change line 30:

$image_intro .= ' src="' . htmlspecialchars($images->image_intro) . '" alt="' . htmlspecialchars($images->image_intro_alt) . '"/></a></div>';


this is based on this tutorial "http://magazine.joomla.org/issues/issue-nov-2012/item/936-add-link-to-article-intro-image-in-joomla25" , but i think is diferent with an artisteer template.

Sorry about my english, i´m still learning.