- This topic has 2 replies, 2 voices, and was last updated 6 years, 3 months ago by
Steve.
Viewing 2 reply threads
-
AuthorPosts
-
-
October 27, 2015 at 11:34 pm #4770
mcmasterMemberNot sure whether I should be doing something different with my fields? Here is the code:
piklist( 'field', array( 'type' => 'group', 'field' => 'home_news', 'label' => 'Featured News', 'description' => 'Information for the home page news feature.', 'template' => 'field', 'columns' => 12, 'fields' => array( array( 'type' => 'text', 'field' => 'section_title', 'columns' => 8, 'label' => 'News Section Title', 'value' => "What's New", ), array( 'type' => 'number', 'field' => 'section_quantity', 'label' => 'Number of Posts', 'description' => 'How many recent posts should we display?', 'value' => 2, 'validate' => array( array( 'type' => 'range', 'options' => array( 'min' => 1, 'max' => 4, ), ), ), ), array( 'type' => 'text', 'field' => 'section_link_text', 'label' => 'Text for Link to News Page', 'value' => 'View All News', 'columns' => 8, 'validate' => array( array( 'type' => 'safe_text', ), ), ), ), ));And attached is an image of the resulting metabox.
Attachments:
You must be logged in to view attached files. -
October 27, 2015 at 11:37 pm #4772
-
October 28, 2015 at 4:04 pm #4781
SteveKeymasterPiklist uses a 12 column grid. So each row of fields should equal 12. Try this:
piklist( 'field', array( 'type' => 'group', 'field' => 'home_news', 'label' => 'Featured News', 'description' => 'Information for the home page news feature.', 'template' => 'field', 'fields' => array( array( 'type' => 'text', 'field' => 'section_title', 'columns' => 8, // First row: 8 columns 'label' => 'News Section Title', 'value' => "What's New", ), array( 'type' => 'number', 'field' => 'section_quantity', 'label' => 'Number of Posts', 'description' => 'How many recent posts should we display?', 'columns' => 4, // First row: 4 columns. Row will end here because 12 columns have been reached. 'value' => 2, 'validate' => array( array( 'type' => 'range', 'options' => array( 'min' => 1, 'max' => 4, ), ), ), ), array( 'type' => 'text', 'field' => 'section_link_text', 'label' => 'Text for Link to News Page', 'value' => 'View All News', 'columns' => 12, // Second row starts here 'validate' => array( array( 'type' => 'safe_text', ), ), ), ), ));
-
-
AuthorPosts
Viewing 2 reply threads
- The topic ‘label misplaced in add-more (0.9.9.4)’ is closed to new replies.