README.md 2.03 KB
Newer Older
Cyrille37 committed
1 2 3
# CommunityVoice

communityvoice.eu
Romain Duminil committed
4 5 6 7 8

## Getting started

1. Upload `CommunityVoice/` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the `Plugins` menu in Wordpress.
Romain Duminil committed
9

Cyrille37 committed
10 11
## Shortcodes

Romain Duminil committed
12
`[positive_vote_nbr]` : return positive vote number
Cyrille37 committed
13

Romain Duminil committed
14
`[negative_vote_nbr]` : return negative vote number
Cyrille37 committed
15

Romain Duminil committed
16
`[positive_vote_btn content="+"]` : display positive vote button
Cyrille37 committed
17

Romain Duminil committed
18
`[negative_vote_btn content="-"]` : display positive vote button
Cyrille37 committed
19

Romain Duminil committed
20
`[comment_nbr]` : return comments number
Cyrille37 committed
21

Romain Duminil committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
## Templates override

You can override default plugin templates by creating `communityVoice` folder in your theme and adding your own templates.

Templates list :

|         Filename         |      Description     | Arguments                           |
|--------------------------|----------------------|-------------------------------------|
| comments_count.php       | Comments number      | commentNbr (optional)               |
| negative_vote_button.php | Negative vote button | data, name, class, value (optional) |
| negative_vote_count.php  | Negative vote number | nbVote                              |
| positive_vote_button.php | Positive vote button | data, name, class, value (optional) |
| positive_vote_count.php  | Positive vote number | nbVote                              |


Example :

> wp-content/themes/myAwesomeTheme/communityVoice/positive_vote_button.php
```
  <input type='button' <?= $args['name'] . ' ' . $args['data'] ?> value='<?= $args['value'] ?>' class="<?= $args['class'] ?>"/>
```

Romain Duminil committed
44
To get help you can copy templates in CommunityVoice plugin.
Cyrille37 committed
45

Romain Duminil committed
46 47 48 49
# CommunityProject

## Shortcodes

Romain Duminil committed
50
`[display_project_nbr singular='projet déposé' plurial='projets déposés']` : display a link to project list with project number
Romain Duminil committed
51 52 53 54 55

`[display_add_project content='Je dépose un projet']` : display a link to add project page

`[project_nbr]` : return project number

Romain Duminil committed
56 57
`[add_project_link]` : return link to add project page

Romain Duminil committed
58
`[display_proposed_project_text singular="projet déposé" plurial="projets déposés"]` : return singular or plurial depending to projects number