For all the high-tech advantages the Cubs seek to master, it was a back-to-basics approach with an added spark at the top of the order Thursday that snapped them out of an offensive funk, at least temporarily.

“Keep your launch angles,” manager Joe Maddon said after a 14-hit attack and a 5-for-9 performance with runners in scoring position produced an 8-5 victory over the Cardinals at chilly but sunny Wrigley Field. “Keep your exit velocities. Give me good at-bats. Those are really good at-bats. Staying inside the ball, using the whole field.

“I promise you — if those guys stay on the same path, balls still are going to go out of the park at the pace they’re capable of. Not a great pace, but the pace they’re capable of. With that, you’ll see better situational hitting, higher batting averages, on-base percentages — all that stuff. I loved our approach.”

With Ben Zobrist nursing a stiff lower back and Ian Happ working with hitting coach Chili Davis on improving from the left side, Maddon was delighted with a resourceful lineup that featured Albert Almora Jr. and Javier Baez hitting first and second.

Almora poked an RBI single to right during a four-run second inning — one of seven opposite-field hits the Cubs produced. They were hitting .191 with runners in scoring position entering play Thursday.

It was Baez, batting second for the first time since 2016, who provided the “energy” Maddon sought at the top with a triple and single — both to right field — in his first two at-bats to help the Cubs take a 6-1 lead after two innings.

Maddon, who said Baez could be like Manny Ramirez once he learns not to chase sliders low and away, nevertheless was reserved in assessing whether the generally free-swinging Baez could hit second on a regular basis.

“lf he has to feed better hitters, he can’t be up there swinging all the time,” Maddon said. “That (approach) is suited better for a lower spot in the order.”

Of Baez’s 14 hits this season, 11 have gone for extra bases. And during this abbreviated seven-game homestand, Baez went 10-for-29 (.345) with five home runs.

“I didn’t get excited because I was hitting second,” Baez said. “But that’s one of my goals, to end up (high) in the lineup. I feel great. I’m still seeing the ball well. I chased a few pitches, but I took good ABs.”

Kyle Schwarber, who has six RBIs in his last six games, didn’t mind taking a back seat to Baez.

“I always feel we’re talking about Javy Baez, and I’m not going to get tired of it,” Schwarber said.

Every Cubs starting position player had at least one hit. Jason Heyward started the four-run rally with an opposite-field single to left and clubbed a two-run homer in the fifth that loomed large after the Cardinals scored four times in the seventh off reliever Eddie Butler.

“We take what we’re given, and if it works out, it works out,” Heyward said.