Gossamer Forum
Home : Products : Gossamer Links : Discussions :

HTML editor

Quote Reply
HTML editor
I am trying to add some articles with images and html code in them.

So looking at this post to add the editor:
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=295800

I added it and working.

But I want this editor to display only to admin in adminpanel (or if possible only to certain users).

How to do it?

Thx.
Quote Reply
Re: [hegu] HTML editor In reply to
Hi hegu,

If you want the editor active only for certain user you can do <%if user.Username eq 'put_username_here'%> do some stuff with the js here<%endif%>

As for the admin panel you need custom plugin for that, there is no specific html template to edit.

Hope this helps.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [hegu] HTML editor In reply to
Hi hegu, For admin side, the only way to do is create a plugin to hook into the add_form hook and replace the required fields to show html with editor because form in admin does NOT use template like user's side. I hope that help!

Cheers,

Dat

Programming and creating plugins and templates
Blog

Last edited by:

tandat: Dec 28, 2012, 7:58 PM
Quote Reply
Re: [tandat] HTML editor In reply to
Hi Dat,

Quote:
...because form in admin does use template like user's side.

I'm afraid this is not true!

The form for the links in the admin panel is generated from GT::SQL::Display::HTML::Table.pm module ... so ... no template files are involved in the process whatsoever. And the only way to add something to the admin templates is via plugin hooks.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] HTML editor In reply to
Hi Boris,

Thanks for your correction! I have edited my post to negate the clause.

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] HTML editor In reply to
Quote:
If you want the editor active only for certain user you can do <%if user.Username eq 'put_username_here'%> do some stuff with the js here<%endif%>

I like option because in future I can extend this for certain users and use this method.

Can anyone of you can elaborate on this please?
Quote Reply
Re: [hegu] HTML editor In reply to
Hi hegu,

The example I gave you should be enough and self explanatory if you have troubles implementing it please give me example URL when I can see how you implemented it, or paste the example html code here.

Without that info, I'm afraid can't be of any help Frown

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins