[solved]Front end editor
-
- Phoca Member
- Posts: 10
- Joined: 31 May 2017, 13:58
[solved]Front end editor
Hi, I would use the editor in the front(jce or tinyMCE or others) end where you insert a description of a file when uploading. The user has enabled the editor but can not see it. Where am I wrong?
Last edited by roberto.c87 on 28 Oct 2017, 11:02, edited 1 time in total.
-
- Phoca Member
- Posts: 10
- Joined: 31 May 2017, 13:58
Re: Front end editor
In an old topic I read that for security reasons you can not use the front end editor. has something changed? Which code can i place and where to use the editor?
- Jan
- Phoca Hero
- Posts: 48550
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Front end editor
Hi, it is not about can or cannot, it is not recommended to use it but of course if your users use it e.g. for articles, etc. then it can be extended to downloads, etc. but this needs to be customized. Instead of displaying the textarea form, the Joomla! editor needs to be set - plus additional check, etc. So for some examples, just take a look at frontend article edit, or for Phoca Guestbook, etc. 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 31 May 2017, 13:58
Re: Front end editor
Thank you for the reply. My intention is to enter the default text in the description using a editor plugin button (regular template). what file generates the frontend page for uploading the files? in which folder is it?
- Jan
- Phoca Hero
- Posts: 48550
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Front end editor
Hi, see:
components\com_phocadownload\views\user\view.html.php
components\com_phocadownload\views\user\tmpl
Jan
components\com_phocadownload\views\user\view.html.php
components\com_phocadownload\views\user\tmpl
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 31 May 2017, 13:58
Re: Front end editor
Thank you for the reply. I do not understand, by going to modify the files you have indicated to me, I do not see the edits in the frontend even by cleaning the cache. I tried to edit all the files in the tmpl folder but nothing happens. the html code generated by the php pages you have shown me coincides with what I see when I look at the page with firebug. So where am I wrong?
-
- Phoca Member
- Posts: 10
- Joined: 31 May 2017, 13:58
Re: Front end editor
also by deleting all the files in the folder \ components \ com_phocadownload \ views \ user \ tmpl all continues to work, so I think some other files
- Jan
- Phoca Hero
- Posts: 48550
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Front end editor
Hi, maybe your template override the component output, try to check your template if it does not override component output 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 31 May 2017, 13:58
Re: Front end editor
thanks for the answer, you were right was a component override issue. I used the following code and the editor is now shown, the problem I'm left behind is that I write is not then recorded, so if I access the file from the backend file the description field is empty.
can you help me?
Code: Select all
jimport( 'joomla.html.editor' );
// GET EDITOR SELECTED IN GLOBAL SETTINGS
$config = JFactory::getConfig();
$global_editor = $config->get( 'editor' );
// GET USER'S DEFAULT EDITOR
$user_editor = JFactory::getUser()->getParam("editor");
if($user_editor && $user_editor !== 'JEditor') {
$selected_editor = $user_editor;
} else {
$selected_editor = $global_editor;
}
// INSTANTIATE THE EDITOR
$editor = JEditor::getInstance($selected_editor);
// SET EDITOR PARAMS
$params = array( 'smilies'=> '0' ,
'style' => '1' ,
'layer' => '0' ,
'table' => '0' ,
'clear_entities'=>'0'
);
........
<tr>
<td><strong><?php echo JText::_( 'COM_PHOCADOWNLOAD_DESCRIPTION' ); ?>:</strong></td>
<td><textarea id="phocadownload-upload-description" name="phocadownloaduploaddescription"
onkeyup="countCharsUpload();" cols="30" rows="10" class="comment-input">
<?php echo $editor->display('content', '', '400', '400', '20', '20', true, null, null, null, $params);?>
<?php $this->formdata->description ?>
</textarea></td>
</tr>
-
- Phoca Member
- Posts: 10
- Joined: 31 May 2017, 13:58
Re: Front end editor
I noticed that the editor is shown out of the textarea, I tried inserting it inside by moving the echo and I get the editor not showing but the following html code:
this is the content of description field in front end.
Code: Select all
<div class="js-editor-tinymce"><textarea
name="description"
id="description"
cols="20"
rows="20"
style="width: 400px; height: 400px;"
class="mce_editable joomla-editor-tinymce"
>