Using editor in frontend

  • Hi,


    I am trying to do an extension for Classified Ads for my Radio-Club Website. This must be simple, ads are a text, perhaps with one or two photos, and each can have a unique category.

    So I thought that starting from the Pagekit's blog extension could be a good idea.


    It works pretty fine, but as I wanted the users be able to write an ad from the front end, I tried to do the same as for an admin.


    I am able to write a new ad, to modify it. The only thing that don't work is that the textarea don't show the editor .


    This is what I get in the admin side ( and would like to have too in the front end).


    And this is what I get in the front. I can edit in the areas but it is not the editor.


    I use the same components/ad-settings.vue for back and front (in the blog this is post-settings.vue).


    Perhaps I can't do the same as in admin side.


    Have you an idea ? It would be fine. :)

  • I have copied the blog/files, just changing post to ad etc..

    I then copied from views/admin/post-edit.php to views/admin/ad-edit.php and to views/ad-edit.php


    views/admin/ad-edit.php :



    and for views/ad-edit.php :



    Then I created a new javascript file :


    The components/ad-settings.vue is the same as for the backend.


    All the fields described in the template components/ad-settings.vue are well shown but only the textarea is a simple textarea without the editor.


    I wonder if this method is also available in front end.


    Thanks for help.

  • Yes, it is in the /app/components/ad-settings.vue and it is the same file for admin and user :



    In the browser many errors :