Adding custom sections to the Content Administrator (Back-End)
support, ws.webtv, advanced, customization, custom, backend, back, end
As a developer, you may need to add new sections to the Content Administrator in order to display additional information, or to allow managing other data different than the one managed natively by the system. Since WS.WebTV v3.1 (release 50) it is possible to add Back-End sections on demand.
What is a custom Back-End section?
Well, it is like a blank canvas. They are pages where the system replaces the title, menu, and other generic CMS data (like texts from the language packs). Since these pages are HTML and do not contain PHP code, you will need to populate them using AJAX. You are free to add all necessary scripts and HTML elements to these pages.
NOTE:
Whenever possible, we recommend using HTML structures (forms, fields, lists, tables, ...) similar to those used in other Back-End pages/templates so that the look of the new pages is consistent with the rest of the Content Administrator.
Explaining with an example:
The following image shows a custom Back-End section:
For the example above we defined a custom Back-End section in the config/Config.inc.php file by adding the following code:
$CUSTOM_BACKEND_SECTIONS["myCustomSection"] = array( "required_access_level" => 1, // 0: Webmaster, 1: Admin, 2: Author, 3: Contributor "title" => "My custom section", "template" => "_sample_custom_backend_section.tpl" );Let' s break the example down:
<script> var accLvl = parseInt("{k.user.accessLevel}"); var customBackEndSectionURL = "myCustomSection"; // must match the array index used in the $CUSTOM_BACKEND_SECTIONS config variable var customBackEndSectionTitle = "My custom section"; // this is the button title (must be as short as possible) if ( accLvl<=1 ) // only add the buttons if user is Webmaster or Admin { // add button into home ... if ( $(".homeButtonsCont").length) $(".homeButtonsCont ul").append('<li><a href="'+SITE_BASE_URL+'index.php/admin/'+customBackEndSectionURL+'/" class="homeButton"><img src="'+SITE_BASE_URL+'public/backend/images/pixel.gif" class="iconSettings" alt=""> '+customBackEndSectionTitle+'</a></li>'); // add button into top menu ... if ( $(".moreOptions").length) $(".moreOptions ul").append('<li><a href="'+SITE_BASE_URL+'index.php/admin/'+customBackEndSectionURL+'/" id="'+customBackEndSectionURL+'"> '+customBackEndSectionTitle+'</a></li>'); } </script>NOTE: In this example, we used the "Settings" icon (class "iconSettings").