Webmastersite.net
Register Log In

Just an idea for WSN links users
Maintaining submit and edit forms

Comments on Just an idea for WSN links users

webflair
Forum Regular

Usergroup: Customer
Joined: Nov 27, 2006

Total Topics: 187
Total Comments: 465
Posted Mar 03, 2009 - 9:00 PM:

OK, so I have started using a new way to maintain my submit and edit forms, and the reason I have done this is that I always found it a pain in the neck to have to edit the suggestlink.tpl and the edit.tpl when changing the look of or characteristics of fields.

Essentially, the submit form in suggest.tpl and edit.tpl are exactly the same within the table it is held, but for the tags field, and the suggest new categories field. So I thought, why on earth am I editing two templates when I can edit just one and have the changes reflect in both the submit and edit form.

So here is what I did...

I created a new template called "commonfields" and I added to it the entire table from suggestlink.tpl.

I surrounded the suggest new category, and tags table rows with the following... <IF {TID} contains suggestlink>Table row goes here</IF>

Once this is done, save the new template as commonfields.tpl.

Now strip out the everything in suggestlink.tpl between..
<span class="important">{INCOMPLETE}</span>

and

<input type="hidden" name="isalbum" value="{ISALBUM}" />

replace with

[INSERTFILE=commonfields]

Then do the same with the edit.tpl file...

Strip out everything between...

<span class="important">{INCOMPLETE}</span>

and

<input type="hidden" name="isalbum" value="{LINKINALBUM}" />

replace with

[INSERTFILE=commonfields]

Now when you want to make changes to your suggest link and edit forms, you only need to edit one file.. commonfields.tpl

It helps me, it may help you.

Note that if you want to do this you should only copy the table from suggestlink.tpl to the new template, everything above the table, and below the table must remain the same. Oh and make sure you make a copy of your suggestlink.tpl and edit.tpl files before trying it.


Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 06, 2009 - 4:17 PM:

When you add a new field, the HTML goes into the appropriate "custom fields" section template instead of into the submit/edit templates themselves. You can edit all your custom fields from the "custom fields" section, only once, instead of having to edit both the submit and edit areas. The custom field templates are [INSERTFILE=]ed into the default submit and edit templates just like you've done there. So, given that, it might be more convenient to just put all the shared fields in the existing 'custom field' templates instead of creating new ones.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Mar 13, 2009 - 6:23 AM:

Thanks Jon! Now why didn't I think of that grin
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.