HOWTO: Change the landing page when you click the module in the module bar

sugarcrmdevelopers —  July 7, 2011 — Leave a comment

By default, when you would click on one of the module names listed in the module bar, it takes you to the ListView for that module so you can search for a record. For some people that may not be the desired behavior, and instead they may want to have it go to the EditView instead so the can create a new record. Fortunately, prolific Sugar community member andopes has a solution for this problem.

For each theme you want to make this customization for you’ll need to modify that theme’s _headerModuleList.tpl file. For the out of the box themes, it is located in either the themes/Sugar5/tpls/ directory ( if you are using the Classic theme ), in the themes/RTL/tpls/ directory ( if you are using the RTL theme ), or in the themes/Sugar/tpls/ directory ( if you are using any of the other themes ). You’ll want to copy this file to the custom directory location of the theme you are making the change for ( custom/themes/Sugar/tpls/ if you are wanting to change the Pacific theme, for example ), and make the following change:

Replace the line

<li>{sugar_link id="moduleTab_$name" module=$name data=$module}

 
by

<li>{sugar_link id="moduleTab_$name" module=$name data=$module action="EditView"}

 
You’ll need to rebuild the theme cache for this to take effect ( which you can do thru a simple Admin -> Repair -> Quick Rebuild and Repair ), and then anytime you click the module header link you’ll be able to create an new record.

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s