Gadgets - gtbu/Typesetter5.2 GitHub Wiki

Gadgets: are content elements of addons (like : Back2Top_Button). They can be added to the layout via Layout Manager or to the content via File Include sections. Gadgets can also be called programmatically from template.php and defined in settings.php

Variable : $GP_GETALLGADGETS ; boolean : Normally used in a theme's settings.php file to define if all available Gadgets should be loaded by default.

The Gadget - Name stands in the addon.ini of the plugin. Gadgets are also used in themes like bootstrap4. gpOutput::Get('Gadget','Gadget_Name');

  • now Typesetter 5.2 : gpOutput::GetGadget('Gadget_Name');

1071 output.php public static function GetGadget($id)

== CMS Built-in Gadgets ==

  • Contact
  • Search
  • Admin Link
  • Login Link

1248 output.php public static function Area($name,$html)

Several code-examples are in the Bootstrap4-Theme !

In **settings.php** :
ob_start();
gpOutput::GetGadget('Search');
$area_content = ob_get_clean();
gpOutput::Area('Search-Gadget', $area_content);
  • and in the template.php (in this case behind the menu : gpOutput::Get('TopTwoMenu'); )
gpOutput::GetArea('Search-Gadget', ''); 
--- 1259 [output.php](https://github.com/gtbu/Typesetter5.2/blob/master/include/tool/Output.php#L1259) : public static function GetArea($name, $text)

or :

if( gpOutput::GadgetExists('Simple_Blog') ){ gpOutput::GetArea('Simple-Blog-Gadget', ''); }  

// as defined in settings.php }

  • Other examples are in the Bootstrap4-Theme

  • Evtl. it is necessary to put the php-call at a specific position of the code (like page-button in the footer)

⚠️ **GitHub.com Fallback** ⚠️