Jan ten Kate
|
Hello,
I am developing a website on a local WAMP server using the latest Artisteer version and Joomla 1.7.2. I encounter the following problem: when I use the read more function in an article, the read more button is shown in the front end, but clicking on it results in showing the Home page in stead of the complete article.
When I change the template to i.e. Beez20, the read more button functions as intended.
Any ideas how to solve this problem?
|
|
Alex
|
Modify ArtxContentListItem.php:
if ($this->_articleParams->get('access-view'))
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
$this->readmoreLink = $link; // add this line
else {
Regards,
Alex
|
|
Alex
|
Correctted code:
if ($this->_articleParams->get('access-view')) {
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
$this->readmoreLink = $link; // add this line
else {
Regards,
Alex
|
|
M.A. Lobert
|
I have the same problem with artisteer 3.1rc1
I tried the code , but maybe i am changing the code wrong but it did't work for me.
|
|
Alex
|
@M.A. Lobert
Please specify exact path to the file you changed and post here several lines above and below your change.
Regards,
Alex
|
|
M.A. Lobert
|
Exact path to file:
~www/steunpuntreizen/templates/steunpuntreizen/classes/ArtxContentListItem.php
else
$this->readmore = JText::_('COM_CONTENT_READ_MORE')
. JHtml::_('string.truncate', $this->_article->title,
$this->_articleParams->get('readmore_limit'));
/*if ($this->_articleParams->get('access-view'))
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));*/
if ($this->_articleParams->get('access-view')) {
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
$this->readmoreLink = $link; // add this line
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
When i change the code to this i get a login form when i press the read more button
|
|
Oduti
|
This code has worked for me
if ($this->_articleParams->get('access-view')) {
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
$this->readmoreLink = $link; }
Regards,
|
|
M.A. Lobert
|
Thanks Oduti the code works for me to
else
$this->readmore = JText::_('COM_CONTENT_READ_MORE')
. JHtml::_('string.truncate', $this->_article->title,
$this->_articleParams->get('readmore_limit'));
/*if ($this->_articleParams->get('access-view'))
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));*/
if ($this->_articleParams->get('access-view')) {
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
$this->readmoreLink = $link; }
else {
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId); Thanks Oduti
|
|
Jan ten Kate
|
Thanks Oduti!
That code worked for me too!
Jan
|
|
Marco Göbenich
|
Hi!
Is this issue already in the bug list for new releases?
Regards
Marco
|
|
Alex
|
@Marco Göbenich
You should ask support for info about releases.
Regards,
A;ex
|
|
Marco Göbenich
|
Quote Alex:
@Marco Göbenich
You should ask support for info about releases.
Regards,
A;ex
Sorry for asking, but don't need your trivial answers, just wanted to know if I should post this as bug, or if somebody allready has done this.
|
|
Dennis
|
Oduti's code is perfect. Thank you!
|
|
Robert Barrett
|
Thanks, Oduti! Worked on my site, too! I sure hope they fix this in the next update, like, for free! $130 means the buttons should work! They should cut you in on the profit share, Oduti!
|
|
António J. B. Ramalho
|
Alex
Why Artisteer did not correct this error yet?
Thanks
|
|
Alex
|
@António
Such questions may be answered by the product support team.
Regards,
Alex
|
|
António J. B. Ramalho
|
You are right Alex, Thanks
|
|
Onno
|
Thanks for all the help above, but I still not manage to change the code right; can someone help me out an tell me what I should change? Here's my current code which does not work at all:
<?php defined('_JEXEC') or die; abstract class ArtxContentListItem extends ArtxContentItem { public $intro; protected function __construct($component, $componentParams, $article, $articleParams) { parent::__construct($component, $componentParams, $article, $articleParams); $this->isPublished = 0 != $this->_article->state; $this->titleLink = $this->_articleParams->get('link_titles') && $this->_articleParams->get('access-view') ? JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)) : ''; $this->intro = $this->_article->introtext; if ($this->_articleParams->get('show_readmore') && $this->_article->readmore) { if (!$this->_articleParams->get('access-view')) $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); elseif ($this->readmore = $this->_article->alternative_readmore) { if ($this->_articleParams->get('show_readmore_title', 0) != 0) $this->readmore .= JHtml::_('string.truncate', ($this->_article->title), $this->_articleParams->get('readmore_limit')); } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0) $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE'); else $this->readmore = JText::_('COM_CONTENT_READ_MORE') . JHtml::_('string.truncate', $this->_article->title, if ($this->_articleParams->get('access-view')) { $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)); $this->readmoreLink = $link; } } else { $menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)); $link = new JURI($link1); $link->setVar('return', base64_encode($returnURL)); $this->readmoreLink = $link->__toString(); } } else { $this->readmore = ''; $this->readmoreLink = ''; } } public function intro($intro) { return "<div class=\"art-article\">" . $intro . "</div>"; }
|
|
VORTO
|
This worked for me:
---------------------------------------------------------------------------------
in the 'Edit Main Page Template' change <div class="art-headerobject"></div>
to <a href="<?php echo $document->baseurl; ?>/"><div class="art-headerobject"></div></a>
---------------------------------------------------------------------------------
|
|
Safarix
|
Hello,
I have this problem and I followed all the indications mentioned here and does not result. I can not show the full text after clicking on Read more.
If anyone wants to help solve this problem here is my file: / MyTemplate / classes / ArtxContentListItem.php (http://www.4shared.com/file/nO9LvZuK/ArtxContentListItem.html?).
Thank you / Obrigado
|
|
Safarix
|
Sorry for the inconvenience. I am using the extension K2 and is misconfigured, so the full text did not appear.
problem solved
|
|
era
|
Thanks for all the help above, but I still not manage to change the code right; can someone help me out an tell me what I should change? Here's my current code which does not work at all:
<?php defined('_JEXEC') or die; abstract class ArtxContentListItem extends ArtxContentItem { public $intro; protected function __construct($component, $componentParams, $article, $articleParams) { parent::__construct($component, $componentParams, $article, $articleParams); $this->isPublished = 0 != $this->_article->state; $this->titleLink = $this->_articleParams->get('link_titles') && $this->_articleParams->get('access-view') ? JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)) : ''; $this->intro = $this->_article->introtext; if ($this->_articleParams->get('show_readmore') && $this->_article->readmore) { if (!$this->_articleParams->get('access-view')) $this->readmore = JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); elseif ($this->readmore = $this->_article->alternative_readmore) { if ($this->_articleParams->get('show_readmore_title', 0) != 0) $this->readmore .= JHtml::_('string.truncate', ($this->_article->title), $this->_articleParams->get('readmore_limit')); } elseif ($this->_articleParams->get('show_readmore_title', 0) == 0) $this->readmore = JText::sprintf('COM_CONTENT_READ_MORE_TITLE'); else $this->readmore = JText::_('COM_CONTENT_READ_MORE') . JHtml::_('string.truncate', $this->_article->title,
if ($this->_articleParams->get('access-view'))
{ $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid));
$this->readmoreLink = $link; }
else {
$menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)); $link = new JURI($link1); $link->setVar('return', base64_encode($returnURL)); $this->readmoreLink = $link->__toString(); } } else { $this->readmore = ''; $this->readmoreLink = ''; } } public function intro($intro) { return "<div class=\"art-article\">" . $intro . "</div>"; }
just copy paste &save it should work!!!
|
|
Mario
|
Its works this code
if ($this->_articleParams->get('access-view')) { $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->_article->slug, $this->_article->catid)); $this->readmoreLink = $link; }
it was one error in before the "else" you should put "}" to close if, now work perfect
sorry for my english id speak spanish
Quote :Este codigo funciona muy bien es solo agregarlo y corregirle "}" para cerrar la sentencia IF por lo demas ya el botón leer mas funciona perfectamente
|
|