ics/userhelp-bundle

Bundle for manage user helps

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:symfony-bundle

0.0.5 2021-12-03 13:09 UTC

This package is auto-updated.

Last update: 2024-04-29 04:41:08 UTC


README

Userhelp management for symfony

This bundle provide javascript help for symfony with :

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

composer require ics/userhelp-bundle

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require ics/userhelp-bundle

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    ICS\UserhelpBundle\UserhelpBundle::class => ['all' => true],
];

Configuration

Help Initialisation

Add this lines in base.html.twig. The code show help only if route is configured in userhelp.yaml

{# ... #}
{{  AddHelpCSS() }}
{% block stylesheets %}

{% endblock %}
{# ... #}
{{  AddHelpJS() }}
{% block javascripts %}

{% endblock %}
{# ... #}
{% block body %}

{% endblock %}
{{ AddHelpHtml() }}

Help configuraton

Create a new file userhelp.yaml

userhelp:
  helpColor: primary
  helpButtonIdentifier: helpButton
  helps:
    homepage: # route to add help
      elements:
        titlePage: # html element id
          position: bottom
          description: Title of the page # help for this element
        mainmenu:
          position: right
          description: Main menu
        homepagelink:
          position: right
          description: return to <i class="fa fa-home"></i> homepage # html is enabled in help element

helpcolor properties values are :

  • primary
  • secondary
  • success
  • warning
  • danger
  • info
  • dark

position property values are :

  • left
  • top
  • right
  • bottom

Intro Initialisation

Routing Installation

Intro needs route for save if user see all intro, configure config/routes.yaml

# config/routes.yaml

userhelp_bundle:
  resource: "@UserhelpBundle/config/routes.yaml"
  prefix: /user/help

Adding js and css files to your base.html.twig. The code show intro only if route is configured in userhelp.yaml

{# base.html.twig #}
{# ... #}
{{  AddIntroCSS() }}
{% block stylesheets %}

{% endblock %}
{# ... #}
{{  AddIntroJS() }}
{% block javascripts %}

{% endblock %}

Intro configuraton

Create a new file userhelp.yaml

userhelp:
  introButtonIdentifier: introButton
  introTheme: modern
  intros:
    homepage: #Route name
      elements:
        pagetitle: #Element where intro step attach
          title: Page title
          description: description of the page title #Support HTML
        leftmenu:
          title: Menu of page
        mainpage:
          title: Content of page
        rightmenu:
          title: Menu of page

introTheme property values are :

  • dark
  • flattener
  • modern
  • nassim
  • nazanin
  • royal