I have installed Phoca Download in my test environment. I saw that when I use the Button plugin to generate code for the Download plugin, the article renders fine when I use this code in a regular Joomla article.
But when I use the button plugin while editing the description part of a file within Phoca Download and I view the file details within Download, then it doesn't resolves the code. It just shows the code: {phocadownload view=file|id=1|target=s} in the description area.
Question: Is this correct behaviour (feature...) or should this have been working (bug...).
I would love to use the button plugin to create extra links to other Download documents which are related to the one I'm editing. The editing part works fine, but the Joomla presentation part seems to skip the code where the Download plugin code is resolved / rendered.
Specs: Working with J1.5.25. Download 1.3.9. Plugin for Download 1.3.6. Button Plugin for Download 1.3.5. These are all the latest J1.5 versions I can find on the Phoca.cz>Download pages.
Download plugin code not rendered in Phoca Download
-
- Phoca Member
- Posts: 27
- Joined: 14 Jan 2011, 21:15
- Location: Netherlands
- Contact:
- Benno
- Phoca Hero
- Posts: 9638
- Joined: 04 Dec 2008, 11:58
- Location: Germany
- Contact:
-
- Phoca Member
- Posts: 27
- Joined: 14 Jan 2011, 21:15
- Location: Netherlands
- Contact:
Re: Download plugin code not rendered in Phoca Download
Hi Benno,
The article refers to Phoca Gallery. But since you also have the Gallery Plugin, I assume the solution is the same for Phoca Download. So I tried to find any line which looks like the one in the article and also checked out all the source files where "desciption" is "echo"-ed. But couldn't find the piece of this puzzle...
I am only using description on the page which you get after pushing de Download button for the first time. Could you point me out in which file and which line of code I should look to apply the "echo JHTML::_('content.prepare', ...)" solution?
Thanks for your help.
Regards, Rob.
The article refers to Phoca Gallery. But since you also have the Gallery Plugin, I assume the solution is the same for Phoca Download. So I tried to find any line which looks like the one in the article and also checked out all the source files where "desciption" is "echo"-ed. But couldn't find the piece of this puzzle...
I am only using description on the page which you get after pushing de Download button for the first time. Could you point me out in which file and which line of code I should look to apply the "echo JHTML::_('content.prepare', ...)" solution?
Thanks for your help.
Regards, Rob.
- Benno
- Phoca Hero
- Posts: 9638
- Joined: 04 Dec 2008, 11:58
- Location: Germany
- Contact:
Re: Download plugin code not rendered in Phoca Download
Hi,
I asked Jan and he said, you should seek in components/com_phocadownload/views/file/tmpl/default.php
Kind regards,
Benno
I asked Jan and he said, you should seek in components/com_phocadownload/views/file/tmpl/default.php
Kind regards,
Benno
-
- Phoca Member
- Posts: 27
- Joined: 14 Jan 2011, 21:15
- Location: Netherlands
- Contact:
Re: Download plugin code not rendered in Phoca Download
Indeed it was in the file components/com_phocadownload/views/file/tmpl/default.php.
The description is not a single field which is echo'd here like in Phoca Gallery, but part of the $details variable.
By calling the "content.prepare" on the $details, all the details-fields are pre-rendered now including description.
Original code:
Edited code:
Problem solved. 
The description is not a single field which is echo'd here like in Phoca Gallery, but part of the $details variable.
By calling the "content.prepare" on the $details, all the details-fields are pre-rendered now including description.
Original code:
Code: Select all
if ($valueDoc->description != '' && $valueDoc->description != '<p> </p>' && $valueDoc->description != '<p> </p>' && $valueDoc->description != '<p></p>' && $valueDoc->description != '<br />') {
$details .= '<tr><td colspan="2">'.$valueDoc->description.'</td></tr>';
}
if ($this->tmpl['display_downloads'] == 1) {
$details .= '<tr><td><strong>'.JText::_('Downloads').'</strong>:</td><td>'.$valueDoc->hits.' x</td></tr>';
}
$details .='</table><p> </p>';
echo $details;
Code: Select all
if ($valueDoc->description != '' && $valueDoc->description != '<p> </p>' && $valueDoc->description != '<p> </p>' && $valueDoc->description != '<p></p>' && $valueDoc->description != '<br />') {
$details .= '<tr><td colspan="2">'.$valueDoc->description.'</td></tr>';
}
if ($this->tmpl['display_downloads'] == 1) {
$details .= '<tr><td><strong>'.JText::_('Downloads').'</strong>:</td><td>'.$valueDoc->hits.' x</td></tr>';
}
$details .='</table><p> </p>';
// Software hack: Call the 'content.prepare' on $details in order to render internal references to other Phoca Donwload files.
// old code: echo $details;
echo JHTML::_('content.prepare', $details);

- Benno
- Phoca Hero
- Posts: 9638
- Joined: 04 Dec 2008, 11:58
- Location: Germany
- Contact:
Re: Download plugin code not rendered in Phoca Download
Well done & thanks for this guide!
Kind regards,
Benno
Kind regards,
Benno