On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • This is a topic for starRating by jerry325

    DESCRIPTION

    This Snippet displays an image of Stars in relation to the "starRating_Rating"
    parameter that is passed to it.

    PARAMETERS:

    &starRating_Rating integer - The rating to display (from 0-10 in .5 steps). REQUIRED!
    $tpl string - the template chunk to use. Default: starRating_Tpl
    $range = integer - the max range of the rating (Five or Ten). Default: Ten
    $image = string - the path to the sprite image. Default: assets/components/starrating/starSprite.png
    there is also a half size version named starSprite_sm or you can create your own.
    $width = integer - the width of the display block. 1/2 the image width in pixels. Default: 360
    $height = integer - the height of the display block. 1/2 the image height in pixels. Default: 36

    version 1.0.0-pl
    author Jerry Mercer (ultravision.net)
    credits Many thanks for the ideas and work of Abdullah Rubiyath

    USAGE: All but starRating_Rating are optional

    [[!starRating?
    &starRating_Rating=`5`
    &starRating_Tpl=`starRating_Tpl`
    &starRating_Range=`Ten`
    &starRating_Image=`assets/components/starrating/starSprite.png`
    &starRating_Width=`360`
    &starRating_Height=`36`
    ]]


    Release Notes
    While working on another project I needed a way to display a rating in a colorfull way. Finding none I
    searched the web and found a CSS slider display by Abdullah Rubiyath. I rewrote to fit my needs and Modx
    and when finished I found I had something that others might want so I packaged it up. As always I would
    be grateful for any and all suggestions for improvements.

    [ed. note: jerry325 last edited this post 4 years, 6 months ago.]