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>
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.
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.
Comments on Just an idea for WSN links users
Forum Regular
Usergroup: Customer
Joined: Nov 27, 2006
Total Topics: 187
Total Comments: 465
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.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Expert
Usergroup: Customer
Joined: Aug 19, 2005
Location: England
Total Topics: 391
Total Comments: 1303
Thanks Jon! Now why didn't I think of that