Looking through the documentations I see that October has built in carts and score Board features, however is there a walkthrough or video showing how to connect live data to them?
I am still muddling my way on developing within October so please treat me at a beginner pace because there is a huge amount of info to consume…
If you’re referring to Scoreboard, it doesn’t automatically connect to live data — you need to pass the values yourself.
For example, if you are showing a scoreboard inside a controller, you can pass data to your view like this:
public function index()
{
// Provide data to the view
$this->vars['scoreboardData'] = 'XYZ';
// Render the default ListController index
return $this->asExtension('ListController')->index();
}
Then in your partial (the .htm file), you can display the value:
<?= $scoreboardData ?>
From there, you could replace 'XYZ' with values coming from your database query, API call, or any calculation you need.
So the scoreboard widget itself is just a UI element — it’s up to you to decide what “live data” you want to push into it.
I guess that would be one of the other places I am struggling… The “XYZ” part Im not sure if I can use a SQL statement there, or do I create a View in SQL and then call it from code in October to view what I want to see…
I am pretty old school on the learning part. It helps me to see a couple different examples of how the same thing can be accomplished. Unfortunately no one seems to do documentation like that anymore. Plus all of the Youtube videos out there for October are so old thats its difficult to consider whats relevant or not…
Looking at the People section and I see the scoreboard part. It appears that the only part that is connected to live data is the first circle chart. Is that correct and if so is there a reason why Mary Smith is reading -2000 and the other two are not reading values.
I just to make sure before I dive too deep into this, because changing the names of the tree indviduals have no affect on the scoreboard.
@adamo I don’t see any date input in your view yet. How are you currently handling the date selection? You could use data-attributes to trigger a function and re-render the scoreboard dynamically when the date changes.
Thank you for your example, however I dont think it solves what I am trying to do.
So ultimately I am tracking jobs in my sign shop. I have a database storing all the info. I am taking this in small step, so ultimately I would like a total count of each job on what phase the status is.
Some of the status include the following:
Awaiting Assignment
On Hold
Production
Awaiting Invoicing
Awaiting Pickup
Completed
Do I need to create a SQL view to get the totals of each and some how tell the scoreboard to look at the values, or do I create a SQL query on the fly through October, which I feel would be counter productive. Or is there a way to get October to total them.
Thanks for the tip, I was trying to do this with some Events like relationExtendRefreshResults or onRelationButtonAdd etc. the idea is to change the scoreboard when CRUD`ing related date to a reservations view. For example if a reservation field changes in the backend the data would be updated.
@adamo got it — so you want this to happen without refreshing the page, since your current code only fetches the updated data on reload.
To achieve real-time updates, you could use WebSockets / broadcasting, which would automatically push changes to the frontend. That said, this approach might be a bit overkill for simply updating a scoreboard, as the setup can be fairly heavy.
A simpler and more practical alternative would be polling every X seconds:
It’s easier to implement, but keep in mind it may result in some unnecessary AJAX calls.