Hello,
is it possible to switch the position of the attachments from the button to the top in an article?
So it would be easier to download attachment in long faqs.
I looked for it in the artikel.tpl, but couldn't find it.
Second question:
How can I set the user permissions of any new faq by default to access for all users?
Thanks in advance!
Switch postition of attachments in an article
Moderator: Thorsten
Re: Switch postition of attachments in an article
Hi,
you can move the position of the attachments in the template file artikel.tpl. The permissions should be access for all by default.
bye
Thorsten
you can move the position of the attachments in the template file artikel.tpl. The permissions should be access for all by default.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Switch postition of attachments in an article
Neither it effects anything to change the position nor to delete these lines in /faq/assets/template/default/artikel.tpl:
The FAQs are still the same. Everytime with the attachment at the buttom.
Code: Select all
[privateNotes]
<div class="pmf-private-notes">
<h4>
{notesHeader}
</h4>
<p>
{notes}
</p>
</div>
[/privateNotes]
Re: Switch postition of attachments in an article
Hi,
the posted code is for private notes, not attachments.
bye
Thorsten
the posted code is for private notes, not attachments.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Switch postition of attachments in an article
I can't find anything with attachment in /faq/assets/template/default/artikel.tpl. The attachment is defined in {writeContent}, but I don't know were to edit the content of {writeContent}.
There is a section in Artikel.php, where "writeContent" is defined:
But there is also no string or something like this for attachment.
All in all I can't find out, where I can change the position of attachment in an article.
There is a section in Artikel.php, where "writeContent" is defined:
Code: Select all
$tpl->parse(
'writeContent',
array(
'baseHref' => $faqSystem->getSystemUri($faqConfig),
'writeRubrik' => $categoryName,
'solution_id' => $faq->faqRecord['solution_id'],
'solution_id_link' => PMF_Link::getSystemRelativeUri().'?solution_id='.$faq->faqRecord['solution_id'],
'writeThema' => $question,
'writeContent' => $answer,
'writeDateMsg' => $date->format($faq->faqRecord['date']),
'writeAuthor' => $faq->faqRecord['author'],
'numberOfComments' => sprintf(
'%d %s',
isset($numComments[$recordId]) ? $numComments[$recordId] : 0,
$PMF_LANG['ad_start_comments']
),
'editThisEntry' => $editThisEntry,
'translationUrl' => $translationUrl,
'languageSelection' => PMF_Language::selectLanguages($LANGCODE, false, $availableLanguages, 'translation'),
'msgTranslateSubmit' => $PMF_LANG['msgTranslateSubmit'],
'saveVotingPATH' => sprintf(
str_replace(
'%',
'%%',
PMF_Link::getSystemRelativeUri('index.php')
).'index.php?%saction=savevoting',
$sids
),
'saveVotingID' => $recordId,
'saveVotingIP' => $_SERVER['REMOTE_ADDR'],
'msgAverageVote' => $PMF_LANG['msgAverageVote'],
'renderVotingStars' => '',
'printVotings' => $faqRating->getVotingResult($recordId),
'switchLanguage' => $faqHelper->renderChangeLanguageSelector($faq, $currentCategory),
'msgVoteUseability' => $PMF_LANG['msgVoteUseability'],
'msgVoteBad' => $PMF_LANG['msgVoteBad'],
'msgVoteGood' => $PMF_LANG['msgVoteGood'],
'msgVoteSubmit' => $PMF_LANG['msgVoteSubmit'],
'writeCommentMsg' => $commentMessage,
'msgWriteComment' => $PMF_LANG['msgWriteComment'],
'id' => $recordId,
'lang' => $lang,
'msgCommentHeader' => $PMF_LANG['msgCommentHeader'],
'msgNewContentName' => $PMF_LANG['msgNewContentName'],
'msgNewContentMail' => $PMF_LANG['msgNewContentMail'],
'defaultContentMail' => ($user instanceof PMF_User_CurrentUser) ? $user->getUserData('email') : '',
'defaultContentName' => ($user instanceof PMF_User_CurrentUser) ? $user->getUserData('display_name') : '',
'msgYourComment' => $PMF_LANG['msgYourComment'],
'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'],
'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'writecomment', $PMF_LANG['msgCaptcha'], $auth),
'writeComments' => $faqComment->getComments($recordId, PMF_Comment::COMMENT_TYPE_FAQ),
'msg_about_faq' => $PMF_LANG['msg_about_faq'],
)
);
All in all I can't find out, where I can change the position of attachment in an article.
Re: Switch postition of attachments in an article
Hi,
you are right. I'm sorry. Here's the code for adding the attachments under the FAQ: https://github.com/thorsten/phpMyFAQ/bl ... #L124-L137
Please change the code to the following in artikel.php:
Add one entry in the artikel.php, e.g.
Then add the {attachments} template variable wherever you want in artikel.tpl.
bye
Thorsten
you are right. I'm sorry. Here's the code for adding the attachments under the FAQ: https://github.com/thorsten/phpMyFAQ/bl ... #L124-L137
Please change the code to the following in artikel.php:
Code: Select all
// List all faq attachments
$attachments = '';
if ($faqConfig->get('records.disableAttachments') && 'yes' == $faq->faqRecord['active']) {
$attList = PMF_Attachment_Factory::fetchByRecordId($faqConfig, $recordId);
$outstr = '';
while (list(, $att) = each($attList)) {
$outstr .= sprintf('<a href="%s">%s</a>, ',
$att->buildUrl(),
$att->getFilename());
}
if (count($attList) > 0) {
$attachments = '<p>'.$PMF_LANG['msgAttachedFiles'].' '.PMF_String::substr($outstr, 0, -2).'</p>';
}
}
Code: Select all
'writeThema' => $question,
'writeContent' => $answer,
'attachments' => $attachments,
'writeDateMsg' => $date->format($faq->faqRecord['date']),
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Switch postition of attachments in an article
Thats awesome! Thank you very much, it works perfectly!