cotonti.com : Merge pade.add and page.edit https://www.cotonti.com Laatste forum onderwerpen Cotonti en Mon, 22 Dec 2025 19:16:41 -0000 Kingsley @ trust. ok, then I am cool with that :)

]]>
Vr, 07 Dec 2012 16:24:59 -0000
Trustmaster @Kingsley

No, it's different from polls. Polls actually have several templates mixed in 1 file. What we propose here is having 1 template (1 MAIN block) for both adding and editing. Which is less work for coders.

@Macik

Yes, support for pade.add.tpl still should be there if the template exists. But by default it would fall back to page.edit.tpl otherwise.

As for hooks, I think they still should be different because some actions are done when a page is added for the first time but not when editing, and vice versa. But e.g. page.add.tags and page.edit.tags can be merged. In other words, each hook needs individual consideration.

]]>
Vr, 07 Dec 2012 12:51:47 -0000
Macik Vote for  «YES», but have several questions…

Is there ability to use one function with different TPLs?  I speak about using 2 tpl - one for add and one for edit.

Or some compromise solution to pass TPL path as a parameter, so (when we adding a page) first we can check is there separate «add» template, otherwise use standart «edit» one.

By the way, is this merge consider any «add/edit.first/tags» hooks? Would it be backwards compatible so old plugins still works?

]]>
Vr, 07 Dec 2012 12:39:09 -0000
Kingsley So in the end it will be more work for coders? Meh.. Do not like combined tpl's.. Like the one of the polls; it's a freaking nightmare..

]]>
Vr, 07 Dec 2012 11:25:55 -0000
lukgoh I dont see any problem with merging them but keeping 2 different templates for the seperate pages. At least this way it wont confuse new people using the CMF. 

]]>
Vr, 07 Dec 2012 10:52:07 -0000
Trustmaster Now that page management is unified underneath, the functionality of page.add and page.edit is almost identical. Therefore they can be merged to reduce code duplication.

Pros:

  • Maintain just page.edit.tpl instead of page.add.tpl and page.edit.tpl.
  • Reduces code redundancy.

Cons:

  • If you need different sets of fields for adding and editing a page, you need to use IFs in the template or still make 2 different templates for add and edit.

What do you think?

]]>
Vr, 07 Dec 2012 10:08:05 -0000