0
Welcome Guest! Login
0 items Join Now

Can the Simple Counter Particle Count Up?

    • Quag's Avatar
    • Quag
    • Jr. Rocketeer
    • Posts: 43
    • Thanks: 0

    Can the Simple Counter Particle Count Up?

    Posted 9 years 7 months ago
    • I'd like to use the Simple Counter particle to count how long I've been doing an activity, which means I need it to count up, not down. For example, I've been doing internet marketing for X Days/Weeks/Months. The X value would increase every day.

      Is there an easy way to do this? Or could we add it as a feature request?
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 22270
    • Thanks: 3224
    • messin' with stuff

    Re: Can the Simple Counter Particle Count Up?

    Posted 9 years 7 months ago
    • We use this open source code for the Simple Counter

      mootools.net/forge/p/simplecounter

      It is located in \templates\rt_YOURTHEME\particles\simplecounter.html.twig

      There is no administrative way to do what you're asking, but perhaps you could consult the code repo I posted and see what modifications you could make
    • The following users have thanked you: Keseru Gabor

    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • Quag's Avatar
    • Quag
    • Jr. Rocketeer
    • Posts: 43
    • Thanks: 0

    Re: Can the Simple Counter Particle Count Up?

    Posted 9 years 7 months ago
    • Thanks for the links, super helpful. I checked the twig file you linked to, it appears there is functionality already built into the code for incrementing or decrementing the countdown. But for some reason, only decrementing works.

      I'm reasonably saavy and am comfortable making modifications, but I'm not a dev and still learning the in's and out's of Gantry 5.

      Any ideas on why it might not be working? Also, if I make changes to the twig file, wouldn't they be overridden with the next Gantry update? Or is there an override system available?
    • Quag's Avatar
    • Quag
    • Jr. Rocketeer
    • Posts: 43
    • Thanks: 0

    Re: Can the Simple Counter Particle Count Up?

    Posted 9 years 7 months ago
    • Also, I tried changing this to false, but it had no effect on the counter.


      		/**
      		 * @var {Boolean} whether to count down (true) or up (false)
      		 */
      		countDown : true,
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 22270
    • Thanks: 3224
    • messin' with stuff

    Re: Can the Simple Counter Particle Count Up?

    Posted 9 years 7 months ago
    • Quag wrote:
      Also, if I make changes to the twig file, wouldn't they be overridden with the next Gantry update? Or is there an override system available?

      It would be overwritten when you update the Theme... I'm pretty sure you could copy the file to /rt_YOUR_THEME/custom/particles/ and make your modifications there, which wouldn't be overwritten upon updating the theme

      docs.gantry.org/gantry5/advanced/customizing-theme-files

      This level of customization is however beyond the scope of support here. Compare the code in our twig file to what's released on that link I provided... perhaps we removed some code that's important for it to count up? Make sure your clearing the cache in-between tests... you can use Chrome's Developer Tools (Dev Tools > Resources > Frames > XXX > Scripts) to ensure that your modified script is actually loading.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:

Time to create page: 0.066 seconds