What is the API ?

More
5 years 9 months ago #3918 by jmbouille
jmbouille created the topic: What is the API ?
It is not documented yet.

All parts use an internal API while rendering in the articles.
This API is usable anywhere in Joomla, for example to use parts in custom components or modules.
The API is actually working, but there is no documentation at that time.

With the API, you can create any part in PHP language, without any javascript. ("php wrapper").
All classes of this API can be visible in the components/com_nge/helpers/api directory

For example :
To display a label "[?]" with a popover (article id 16 in the content popover) : the syntax is about :

$helpPart = NGE::part('text.label');
$helpPart->label = '[?]';
$helpPart->style = 'dotted';
$helpPart->popover->position = 'bottom';
$helpPart->popover->caption = 'Help to import a file';
$helpPart->popover->style='custom';
$helpPart->popover->trigger='hover';
$helpPart->popover->font->color = '#ffffff';
$helpPart->popover->background->color = '#6597DC';
$helpPart->popover->width->mode = 'custom';
$helpPart->popover->width='800';
$helpPart->popover->source='article';
$helpPart->popover->article = '16';

$helpPart->display();

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum