renobird Posted January 8, 2014 Share Posted January 8, 2014 Is it possible to get the columnWidth of a field via the API? Looks like columnWidth is stored in "data", not sure how I can access that. $field-> Link to comment Share on other sites More sharing options...
Soma Posted January 8, 2014 Share Posted January 8, 2014 // via field settings $field = $fields->get("title"); echo "width:" . $field->columnWidth; // via template context $tpl = $templates->get("basic-page"); $field = $tpl->fieldgroup->getField("title", true); // true for template context echo "width:" . $field->columnWidth; https://gist.github.com/somatonic/8323844 5 Link to comment Share on other sites More sharing options...
renobird Posted January 8, 2014 Author Share Posted January 8, 2014 Thanks Soma, I was trying that with no luck. Then after you confirmed it should work, I realized that 100% width probably didn't output anything. Set the width to something less, and bingo! Long day. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now