Skip to content

jmdeldin/jmd_rate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jmd_rate: A CSS Star Rater

<txp:jmd_rate/> is a CSS star rater that features customizable output and a rating-CSS generator.

Requirements

Tag overview

Tag Attributes Context Description
<txp:jmd_rate> class, stars, star_width, wraptag Article Required container tag
<txp:jmd_rate_display/> jmd_rate Displays rater
<txp:if_jmd_rate_votes> jmd_rate Checks for votes
<txp:jmd_rate_max/> jmd_rate Maximum rating possible
<txp:jmd_rate_rating/> if_jmd_rate_votes Returns the current rating
<txp:jmd_rate_votes/> singular, plural if_jmd_rate_votes Returns the number of votes
<txp:if_jmd_rate_voted/> jmd_rate, if_jmd_rate_votes Checks if the user has voted
<txp:jmd_rate_article/> max_value, min_value, sort Anywhere Article custom for ratings

Example

<txp:hide>Either in an article or article form:</txp:hide>
<txp:jmd_rate>
    <txp:if_jmd_rate_votes>
        <p>
            Currently rated <txp:jmd_rate_rating/>/<txp:jmd_rate_max/>
            after 
            <txp:jmd_rate_votes singular="vote" plural="votes"/>.
        </p>
    <txp:else/>
        <p>
            This article hasn&#8217;t been rated.
        </p>
    </txp:if_jmd_rate_votes>

    <txp:jmd_rate_display/>

    <txp:if_jmd_rate_voted>
        <p>
            Thanks for voting.
        </p>
    </txp:if_jmd_rate_voted>
</txp:jmd_rate>

<txp:jmd_rate>

Attribute Available values Default value Description
class rating rating Class for wraptag
stars INT 4 Number of stars (maximum value)
star_width INT 19 Width of a single star
wraptag * div Container HTML element
<txp:jmd_rate class="my_rater" stars="100" star_width="42" wraptag="li">
    <txp:jmd_rate_display/>
</txp:jmd_rate>

<txp:jmd_rate_votes/>

Attributes Available values Default value Description
singular Text displayed for one vote
plural Text displayed for multiple votes
<txp:jmd_rate_votes singular="vote" plural="votes"/>

<txp:jmd_rate_article/>

<txp:jmd_rate_article/> is an article_custom tag that displays articles based on rating-range. You

Attributes Available values Default value Description
max_rating INT Maximum rating
min_rating INT Minimum rating
sort ASC, DESC DESC Sort order of articles, based on rating
form * default Article form used for display.

Standard article_custom attributes: author, category, form, keywords, month, section

<txp:hide>Page or form template:</txp:hide>
<ol>
    <txp:jmd_rate_article form="highest_rated" max_value="10" min_value="8" section="articles" />
</ol>

<txp:hide>Article form: highest_rated</txp:hide>
<li>
    <txp:permlink>
        <txp:title/>
    </txp:permlink>:
    <txp:jmd_rate>
        <txp:jmd_rate_rating/>/<txp:jmd_rate_max/>
    </txp:jmd_rate>
</li>

About

Textpattern plugin: CSS star rater (old, unsupported).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages