Plugin Framework Function refreshPluginSlotAnchorAndJS()

public final function refreshPluginSlotAnchorAndJS(
$requests = '', $scrollToTopOfSlot = true, $fadeOutAndIn = true
)

Summary

A shortcut function for calling refreshPluginSlotAnchor() and refreshPluginSlotJS().

Where You Can Use It

Can be used in methods called by plugins. From Zenario 7.0.0 onwards.

Description

If you are adding links to a Framework, it's best to add both an anchor link for <a> elements and an onclick script for buttons, so that Theme creators have a choice of which they use. This shortcut function lets you quickly add both.

Parameters

$requests

Any GET requests you wish the Plugin to see as it is reloaded. Should be in the format:

request1=value&request2=value

Note that you can't use POST. If you need POST then you should use a form instead; see the openForm utility function for details.

$scrollToTopOfSlot

From version 5.2.2, you can use this parameter to control whether the Visitor's page should scroll back up to the top of the Slot when it is refreshed.

$fadeOutAndIn

From version 6.0, you can use this parameter to control whether or not the Slot should become semi-transparent while the AJAX call is in progress.

Return Value

An array containing the return values of the refreshPluginSlotAnchor() and the refreshPluginSlotJS() functions.

Example

list($this->mergeFields['Anchor_Link'], $this->mergeFields['JS_Link']) =
    $this->refreshPluginSlotAnchorAndJS('request=value');
<a <!--Anchor_Link-->><!--_CLICK_ON_THIS_LINK--></a>

...or...

<input type="button" onclick="<!--JS_Link-->" value="<!--_CLICK_ON_THIS_BUTTON-->/>

This example illustrates how to put a link on a theme.