Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Custom forms for Editors

(Page 1 of 2)
> >
Quote Reply
Custom forms for Editors
Hi,

I would like to customize forms that are displayed when an editor manages his links.

I would like to "hide" some fields that are not useful for them in my project (eg.: Hits, Contact Name, LinkOwner, etc...)

Do you know how can I get the forms displayed exactly with the fields I want ?

I see the forms are displayed with the tag <%form%>. Where can I customize it ? Is my need easy to manage ?

Any suggestion would be much appreciated.

Thank you, again, again and again.

Regards,

Gautier.
Quote Reply
Re: [Gautier] Custom forms for Editors In reply to
Hi Gautier,

This is a question/problem I brought up many posts ago.

I too wish to hide varoius form fields from my editors when they are adding/modifying etc- for example, custom advertising fields for various premium link options.

I am seriously considering adding something into my editors plugin if I can work out how to do this. Otherwise, it would be nice to have some feedback from GT on how to do this as a mod.

(Thats two of us wanting this then!)

Ian


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jul 3, 2002, 9:44 AM
Quote Reply
Re: [Ian] Custom forms for Editors In reply to
It would be great if you could do something about modifying what the <%form%> displays. I have added many extra columns in the links properties and do not what the editors to access all that extra information. Lsql is really custumizable, but the editor side of things can still be improved greatly. If your EM plug in could fill this gap, that would be helpful for me : )

Last edited by:

nt6: Jul 3, 2002, 3:57 PM
Quote Reply
Re: [nt6] Custom forms for Editors In reply to
Hi,

I will look into shortly.

I think the solution may be to change the custom fields to 'hidden', and have the fields visible from the editor monitor only. The reason for this, is it appears that whatever you do to the editors form, also happens to the admin's form. This is because the two appear to be created by the same module.

Modifying the core code is something I prefer to stay away from, so this may be the way to go.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Custom forms for Editors In reply to
Hi Ian,



If the custom columns could be hidden based on a conditional statement like:

<%if something%>the column is hidden

<%else%> show column value

<%endif%>



You would do me a great favor : )
Quote Reply
Re: [nt6] Custom forms for Editors In reply to
Hi Ian,

Thank you for your suggestion, if you could do something for me I would be glad.

Regards,

Gautier.
Quote Reply
Re: [Gautier] Custom forms for Editors In reply to
To do so, I cannot gather the form that is displayed with the tag <%form%>, paste it to my template, and declare some fields as "hidden" ?

If I can, I wonder where is the form in the Links SQL's files.

Regards,

Gautier.
Quote Reply
Re: [Gautier] Custom forms for Editors In reply to
Sorry for the last post, I forgot that module gathers informations about the fields. Tongue

Iaaaan !!! Please contact me in private if you think you can do something for me about this... Because the worst is I need this feature shortly Unsure.

Thank you.

Regards,

Gautier.
Quote Reply
Re: [Gautier] Custom forms for Editors In reply to
In Reply To:
If I can, I wonder where is the form in the Links SQL's files.
It is located in your templates folder. File name is "include_form.html"
Quote Reply
Re: [Payooo] Custom forms for Editors In reply to
Hi Payooo,

If we speak about link owners, yes, the form is "include_form.html".

But we are talking about the Editors'form and how could we customize it to hide some fields such as "Add Date", "Mod date", "LinkOwner", etc...

It seems it is not easy to customize this form indeed.

Regards,

Gautier.
Quote Reply
Re: [Gautier] Custom forms for Editors In reply to
What about adding/updating the display routine (pre hook) such that if a Link.html template is called, and the user is an editor, certain feilds are nulled out? Could be broadened to run on any template, actually, if User::status eq editor

I was thinking it could be even done inside the templates, if you used the "loop" format for displaying stuff, by having a function that was called (perhaps several times, at the top of the template, and inside any print loop) that stripped out the tags you didn't want seen.

The advantage of this is that it's template based (or plugin based) rather than code edited.

The system would be analogous to the "hidden fields" system used to hide fields from users, but only triggered when an editor (or browser_ template was triggered and the user was an editor, not an admin) display was requested.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Custom forms for Editors In reply to
Interesting solution, good idea.

I was actually thinking of re-doing the whole form as part of a plug-in (re-route depending if it is an admin/editor/user), but your solution looks simpler.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Custom forms for Editors In reply to
Simple is good, right :)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Ian] Custom forms for Editors In reply to
Hi Ian,



Any progress ?
Quote Reply
Re: [nt6] Custom forms for Editors In reply to
I have a solution for this problem, it comes mainly in the form of a very simple plugin (there is one option: a list of fields you want hidden for your editors).

You would also need to change three lines of code in Links/Browser.pm. I am still checking if these code hacks would interfere with something else, but I don't think so. After all, I don't want to mess up something else.

I will post the plugin here, and also instructions for changing the code once I have tested this more.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Custom forms for Editors In reply to
Hi Ivan,

Great!


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [yogi] Custom forms for Editors In reply to
Great Yogi,



could this show / hide be based on a conditional statement?
Quote Reply
Re: [nt6] Custom forms for Editors In reply to
What sort of conditional statement are you thinking of?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Ian] Custom forms for Editors In reply to
Here is the plugin. In the options you can define a comma separated list of field names that you don't want your editors to see.

In Links/Browser.pm you also need to replace (at three different places):

my $h = new GT::SQL::Display::HTML::Table ( { db => $links, input => $link_info } );

with

my $h = new Links::Link::HTML ( { db => $links, input => $link_info } );

As far as I have tested it, it works. You should test it yourself also before you use it on a live site. Possible problems: you have to log into Links SQL as an administrator, if you want to see all fields (even in the admin area).

Have fun.

Ivan
-----
Iyengar Yoga Resources / GT Plugins

Last edited by:

Paul: Aug 2, 2002, 5:33 AM
Quote Reply
Re: [yogi] Custom forms for Editors In reply to
Ivan,



something like <%if isnot validated%> then show, or vice versa.



Also it would be great if we could display the form elements in the order that we want and not just see them ordered by the column ID order. It's quite confusing to have to jump from top to bottom of the form just because every additional column goes directly to the bottom of the form.
Quote Reply
Re: [yogi] Custom forms for Editors In reply to
Hi Ivan,

Your plugin seems to work perfectly Smile. Many thanks from France, that's great !!

Regards,

Gautier.
Quote Reply
Re: [yogi] Custom forms for Editors In reply to
Yogi,



1) I only found two places were I replaced the code in browser.pm, is this normal?

2) Otherwise this is a nice plug in. What about conditional statements like <%if isvaladated eq yes%>show field. Would this be hard to implement?

3) Also, how about being able to reorganize the order of display of the fields? It would be nice if we could type the column ID order so that two added column to the links properties tables are right next to each other.


4) The plugin worked when I tried to modify an existing record, but not when I tried to create a new one. The list of hidden fields included 'Votes' and a few others that were all visible, but blank instead of filled out automatically.

Thank you for your work.

Last edited by:

nt6: Jul 15, 2002, 4:55 AM
Quote Reply
Re: [nt6] Custom forms for Editors In reply to
1. there should be three.

2. a condition like this is difficult to implement because it can't be done in the template, it has to be done in the code.

3. reorganization is difficult, too. Maybe you can change the table order in MySQL, but not through Links SQL, as far as I see.

4. the plugin is just a quick hack. Can you try disabling the hook "handle_editor" (Installed Plugins -> Action -> Edit) and see if the problem is still there?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Custom forms for Editors In reply to
Hi Yogi,

1. I had only one string to replace Tongue (I have Links SQL 2.1.1).

4. I tried this and the problem is still here unfortunately. I don't want to bore you, please can I ask you if it would be possible to let the Plugin work when we add a link ?

Thank you !! Your help is much appreciated. Smile

Regards,

Gautier.
Quote Reply
Re: [yogi] Custom forms for Editors In reply to
3.

When you have a minute, could your please explain to me what needs to be done to change the display order of a column in a table.





Thank you Ivan

Last edited by:

nt6: Jul 15, 2002, 6:53 AM
> >