Child pages
  • [custom] Make use of default template parameters in admin console templates
Skip to end of metadata
Go to start of metadata

Imported From:

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.

Related Tasks

MCUS-9 - Getting issue details... STATUS


  1. 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)?


  2. 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 :)
  3. 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?


  4. 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.

  5. 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.



  6. 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

  7. 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.


  8. I also like doing it this way:

    > we don't need to scroll down and find anything else

  9. Attaching new Patch and task (ready for testing) for this discussion.

    1008: Use Default Template parameters in Admin templates

    MCUS-9 - Getting issue details... STATUS

    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.