Contents
- Introduction Introduction
- getArticleCardLayout Retrieve the card layout for articles
- updateArticleCardLayout Update the card layout for articles
Introduction
Card layouts represent the available fields for articles, relations and employees, and their configuration and visual representation.
getArticleCardLayout Retrieve the card layout for articles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?php require_once('Mplusqapiclient.php'); $mplusqapiclient = new Mplusqapiclient(); // Initialize the client with your details. // Then we call the getArticleCardLayout() function wrapped in a try/catch block to intercept any exceptions. try { if (false !== ($article_card_layout = $mplusqapiclient->getArticleCardLayout())) { var_dump($article_card_layout); exit('Retrieved article card layout.'); } else { exit('Unable to retrieve article card layout.'); } } catch (MplusQAPIException $e) { exit($e->getMessage()); } |
updateArticleCardLayout Update the card layout for articles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<?php require_once('Mplusqapiclient.php'); $mplusqapiclient = new Mplusqapiclient(); // Initialize the client with your details. $article_card_layout = array( 'cardLayoutFieldList' => array( 'cardLayoutField' => array( array( 'cardLayoutFieldId' => xxx, // insert intended cardLayoutFieldId 'infoPopup' => true, // use this field in the information pop-up ), ), ), ); // Then we call the updateArticleCardLayout() function wrapped in a try/catch block to intercept any exceptions. try { if (false !== $mplusqapiclient->updateArticleCardLayout($article_card_layout)) { exit('Updated article card layout.'); } else { exit('Unable to update article card layout.'); } } catch (MplusQAPIException $e) { exit($e->getMessage()); } |