Getting rid of redundant code
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:
Cons:
What do you think? May the Source be with you!
|
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. |
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.. |
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? https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |
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. May the Source be with you!
|
Kingsley |
|
---|---|
@ trust. ok, then I am cool with that :) |