• http://
  • .yourcommunify.com
  • Go!

Advanced settings

Show content via JavaScript

 

cfy.show(content_id, options);

 

Definition:
Allows you to visualize a plugin content vía javascript.

Parameters:
[content_id]
- We can show a specific plugin passing by parameter the content_id of the plugin that we want to visualize.
- If you do not pass any content_id, the plugin related to the corresponding url will be displayed.

[options]
- We can pass parameters to values ​​that will be added to the form when a lead is generated from the form. The key-value elements inside the form_hidden object will be added to the form as hidden fields.
Example:
var options = {
    form_hidden: {
        cta: 'dummy cta',
        time: 1000
    }
};

cfy.show (content_id, options);

In this case, all 'cta' and 'time' elements will be added to the form as hidden fields with the values ​​'dummy cta' and '1000' respectively.



- We can assign dynamic content by parameter. Once defined some variables on our backoffice editor, this ones will show the content we define in our param content, as an array of objects key-value.
Example:
var options = {
    content: [
        { id: '111', value: 'content A' },
        { id: '222', value: 'content B' }
    ]
};

cfy.show (content_id, options);

On our editor backoffice editor we had two dynamic variables defined as {{111}} and {{222}} and, once executed the JS code, when viewing the plugin content, this will show "content A" and "content B" where these variables were defined.



- We could set the language of the plugin we want to show.
Example:
var options = {
  language: 'es'
};

cfy.show (content_id, options);

On our backoffice editor we would have a plugin with the option multilanguage enabled. Guess we have to initial pages, defined as English (en) and Spanish (es). Once executed the JS code, the plugin will be shown with the initial page in Spanish.


Usage:
- Embedded in HTML elements
Dummy text

- In JS files
In any JS file the function can be called.
var example = function () {
    cfy.show ();
}


Important note:
In the latter case, the file that calls the cfy.show() function must be located below the Communify application's initialization script, otherwise the object cfy will not be defined yet.




Showing designed content with a delay time

 

Definition:
Assigning a time interval (in seconds) to open the contents of these past plugin after the selected seconds.

Usage:
Using the following HTML tags:
- data-cfy-delay-time: Defines the number of seconds that is expected to display the content. The defined time can not be less than 5 seconds.
- data-cfy-content-id: (Optional). Content_id defines a particular widget to show. If No parameters are passed content related to the corresponding url plugin is displayed.

Example:
 

In this case the widget with id 123456 content will show up and take 11 seconds to display the content.