This page contains different examples of how the integrated course button can be configured and will work.
The prerequisite for the course buttons to work is that the CORS configuration has been done properly on the open edX side.
This button loads the default configurations for all buttons.
This looks different because an additional css class is added to the button.
This will have a different label, because they are overwritten in the button configuration.
This will link to a different place, because the target links are being overwritten.
As part of the WordPress Open edX integrator, you can use a Shortcode (edunext_enroll_button) to add a Course button to your pages or posts. This button will be linked to one of your Open edX courses and it will link your post or page will the course as required, according to the Open edX user session and the course settings.
In the most simple configuration, the button will behave and look as specified in the Open edX integrator plugin settings.
To specify a custom class for the container, button or color you may use the attributes button_class_generic, container_class_generic, color_class_generic
There are 5 alternative buttons. One of them will appear depending on the learner state and course settings:
There are some settings that can be customized for each button type, including the label, and some CSS classes to be used with the markup. This customizations can be done for all the Course buttons across the site from the Open edX integrator plugin settings page.
Additionally, the properties can be overwritten for a single button, by adding the desired property and value inside the Shortcode. for example you want to customize how this particular button looks when in the case of “invitation_only” you may use this Shortcode:
You only need to include the properties you want to override in each button. The list of possible variables you can override is:
It is possible to set a link for each state with the attribute link_<state> For example: if you want to set a landing page or e-commerce when the status is enroll, you can set it as link_enroll=”https://myexample.com”
You may also use the attribute hide_if=”not logged in” if you want to hide the button when the user is NOT logged in. Inversely you may use the attribute hide_if=”logged in” if you want to hide the button when the user is logged in