Make use of default template parameters in admin console templates

7 views
Skip to first unread message

Alexander Obuhovich

unread,
Feb 8, 2011, 7:14:02 AM2/8/11
to In-Portal Development
Currently in list/edit templates at least 3 words are repeated a lot, which makes harder to create one section from another:
  • unit config prefix
  • grid name

We could unify them by using <inp2:m_DefaultParam tag like this:

<inp2:m_DefaultParam prefix="user" grid="RegularUsers"/>

and where needed replace "user" with $user (when inside the tag) and with <inp2:m_Param name="prefix"/> (when inside HTML).

Actually Nikita has suggested similar idea already, but maybe it's not yet record into groups.

Such approach also make most important template configuration parameters easy accessible, since they will be at the first line of template.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Feb 8, 2011, 10:49:29 AM2/8/11
to in-por...@googlegroups.com
Finally! Well, I was saying the same for the past year. 


I am all for it and even ready to redo current grids if needed!


What other think (who know what we are talking about)?


DA

Nikita

unread,
Feb 28, 2011, 11:42:58 AM2/28/11
to In-Portal Development Team
I like this idea. But i have one question: some time ago i have come
across one idea, which could overlap with this one.
Notice how similar all the admin templates are. Even here Alex is
talking about removing last differing thing. So, what do you think
about defining all the things in unit config? All the grid buttons,
tabs etc. and as a result - absolutely getting rid of admin templates?
Im afraid that this invention could go against the standards of in-
portal, but... It doesnt cost to post :)

Dmitry A.

unread,
Feb 28, 2011, 11:58:36 AM2/28/11
to in-por...@googlegroups.com
Hi Nikita,


I was looking for this post for about a week now and here you are  - so thanks for finding it first of all! :)

I kind of got tired of changing things in Admin Templates over and over again when it's a simple Admin template.

There are PROS and CONS with that idea of yours and I like PROS while CONS can cost of flexibility in the Templates and system overall. I guess it's the price you pay when you are trying to minimize things too much.

Overall, I am for the idea of minimizing the work for all of us, but we definitely need to consider our main approach - Business logic is separated from Designs, otherwise we might shoot ourselves in the foot down the road.


Let's see what others have to say?


DA

Alexander Obuhovich

unread,
Feb 28, 2011, 12:39:14 PM2/28/11
to in-por...@googlegroups.com
Let's start with my proposal and see how it goes. If overall developer satisfaction with new section development speed will be enough then we'll consider our next step.

Dmitry A.

unread,
Feb 28, 2011, 3:36:03 PM2/28/11
to in-por...@googlegroups.com
Hi Guys,


I am attaching a Patch with test version for this approach used on Widget prefix under Custom module. Please note that I have went a little beyond discussed options and added a few more Default Params to make things even simpler during the setup.

In result we have:

<inp2:m_DefaultParam prefix="widget" grid="Default" title_preset="widget_edit" section="custom:widgets" id_field="WidgetId"/>

Works like a charm!

I am also thinking about possibility of adding Default Params for Edit Template, so it looks like edit_template="custom/widgets/widget_edit" and changed along with others.

Please let me know your thoughts.


DA
Default-Template-Parameters-in-Admin-WIDGETS.patch

Alexander Obuhovich

unread,
Feb 28, 2011, 5:03:50 PM2/28/11
to in-por...@googlegroups.com
Why parameters, that are used only once still moved to default params? Since they were used only once in all previous In-Portal version, then it looks like it stays this way at least for a while.

I agree about "edit_template" though, since it's used twice on most of list templates.

Dmitry A.

unread,
Feb 28, 2011, 5:12:27 PM2/28/11
to in-por...@googlegroups.com
Well, I was thinking from the point of simplifying the works for us.

We all know that we going to be editing that DefaultParam part in the template which means we don't need to scroll down and find anything else (ie id_field) in the template which will save the time by default. In result I am going to edit DefaultParam, not worrying about finding that IdField anywhere since it's pretty standard thing to have on Grid and Edit template.

I hope it makes sense.

DA

Nikita

unread,
Mar 1, 2011, 3:06:56 AM3/1/11
to In-Portal Development Team
I also like doing it this way:
> we don't need to scroll down and find anything else

About configs/admin templates: i agree with Alex, lets try minimizing
work with DefaultParams, then we'll see if we still need to change
something.

P.S. Not tested this patch yet.

Dmitry A.

unread,
Mar 1, 2011, 6:45:03 PM3/1/11
to in-por...@googlegroups.com
Attaching new Patch and task (ready for testing) for this discussion.


1008: Use Default Template parameters in Admin templates



Nikita, would you please take a lead and test the patch and update the Task as needed.

Feel free to contact me directly if any questions.


Cheers!

DA
Default-Template-Parameters-in-Admin-WIDGETS.patch
Reply all
Reply to author
Forward
0 new messages