Hi there
Can someone tell me if it is possible to have 3 or 4 fields on each line instead of 2.
I have a few check boxes that i wish to use but would like more than 2 on each line in the Accounts layout detail view.
Look forward to some help here.
Hi there
Can someone tell me if it is possible to have 3 or 4 fields on each line instead of 2.
I have a few check boxes that i wish to use but would like more than 2 on each line in the Accounts layout detail view.
Look forward to some help here.
Hi time2see,
It can be done.
Sugar by default lines everything up in two columns, but it's easy to increase the number of columns. But for a row of checkboxes that means they are algined above and below the text fields, etc that are much bigger.
The other option is to create your own 'Field' definition that treats several fields as one and lets you tell them exactly how to lay them out, add buttons, add features etc.
Look at the Email addresses and Addresses on Contacts and Accounts. These are both layed out this way. In edit view you see the Primary and Opt out checkboxes right next to the email address, plus the link to add email addresses and for Address you see different size boxes layed out next to each other with the Copy from left checkbox below.
These are defined using Smarty templates and gets you into coding right away, so this is not a Studio customization. But if you're up for some coding, look at <sugarroot>/include/SugarFields/Fields. There is also a tutorial for adding a YouTube field on the Wiki that explains how these work.
Take a look and post any specific questions if the answer didn't scare you away.
Phil
Thanks for the reply Phil
I have taken a look at the mentioned folder and have had a look at a few of the files.
Nothing in there looked as though i could add a column to my untrained eye.
If I just wanted to make extra drop downs instead of check boxes, does that change how I go about it?
Is there a tutorial for adding an extra column?
I have no problem getting into coding but do need a bit of help.
Thanks once again for your time.
hi,
there is a setting to have a columns more than two.
you just have to set 'maxColumns' => '3' in editviewdefs or detailviewdefs whatever you want.
hope it helps you
Best Regards
---------------------------------------
Jaydeepsinh Sagar
Hi Jaydeepsinh
I don't have "maxcolums" in any of the files under <sugarroot>/include/SugarFields/Fields that contain that or am i in the wrong place
Hi time2see,
First let's clarify what you want. What I understand you are requesting is to add a column to one row without affecting the other rows so that you can show several checkbox fields close together. This is different than showing 3 columns of fields for the entire page, which would result in for example 3 long text fields on the first line and 3 small checkboxes on the second line, etc.
If you want 3 columns for the entire page, here are the top several lines of my file custom/modules/Accounts/metadata/editviewdefs.php:
Note that maxColumns is set to '2' and the widths of the data and labels for each column are set below it.PHP Code:<?php
// created: 2010-03-05 18:41:27
$viewdefs['Accounts']['EditView'] = array (
'templateMeta' =>
array (
'form' =>
array (
'buttons' =>
array (
0 => 'SAVE',
1 => 'CANCEL',
),
),
'maxColumns' => '2',
'widths' =>
array (
0 =>
array (
'label' => '15',
'field' => '25',
),
1 =>
array (
'label' => '15',
'field' => '25',
),
),
But if you want to set the columns of one row differently than the others you can use the SugarFields. The tutorial for handling SugarFields that I mentioned in my first post is here. This tutorial does not add a column per se, but it explains how to use the SugarFields so that you will better understand how to create your own template. Then you can look at the Email and Address templates as examples and lay out a set of fields however you want.
Phil
FYI, I realized I could use customCode to define one-off Smarty displays in a single field. Just put multiple fields into a single field through custom code.
When you have a set of fields you use over and over from different tables define a new SugarFIeld. But when you have one set of fields in a single module, just use 'customCode' like in this example from my custom/modules/Accounts/metadata/detailviewdefs:
You can do the same in editviewdefs definiing your own input boxes. I chose to display Yes/No rather than a checkbox for easier saves.PHP Code:'lbl_panel6' =>
array (
0 =>
array (
0 =>
array (
'name' => 'has_mazaks_c',
'label' => 'LBL_MACHINES',
'customCode' => '<u>{$MOD.LBL_HAS_MAZAKS}:</u> {if $fields.has_mazaks_c.value}<i>Yes</i>{else}<i>No</i>{/if} <u>{$MOD.LBL_HAS_MILLS}:</u> {if $fields.has_mills_c.value}<i>Yes</i>{else}<i>No</i>{/if} <u>{$MOD.LBL_HAS_LATHES}:</u> {if $fields.has_lathes_c.value}<i>Yes</i>{else}<i>No</i>{/if} <u>{$MOD.LBL_HAS_EDM}:</u> {if $fields.has_edm_c.value}<i>Yes</i>{else}<i>No</i>{/if} <u>{$MOD.LBL_HAS_LASERS}:</u> {if $fields.has_lasers_c.value}<i>Yes</i>{else}<i>No</i>{/if} <u>{$MOD.LBL_HAS_WATERJET}:</u> {if $fields.has_waterjet_c.value}<i>Yes</i>{else}<i>No</i>{/if}',
),
),
Phil
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks