1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Creating content from json and database

Discussion in 'Free Divi Community Forum' started by Chalkie, May 16, 2021.

  1. Chalkie

    Chalkie New Member

    Good afternoon,

    This is going to sound a bit of a strange setup, I am creating a football team website, I have created a row designed to show either fixtures or scores depending on the page, when the page is called depending on whether its a development team or the first team it will either show data from an external json file which I already have that coded to display in a table, or from the database again displaying as a table.

    But within wordpress I use a foreach function to display each element.

    So what is the best method for creating a 3 column row on the fly on a page rather than being static?

    Is it even possible with Divi?

    I have been trying for 2 days to figure this out, the biggest issue I am having is being able to create a php element within a section without creating a row.

    And as I understand it I can't just put divi code into a php excerpt in a plugin unless the page is setup for divi, so going around in a circle.

    I hope someone can either point me in the direction or give me a straight now and then explain to the financers why they just spent £249 (not my idea by the way) on something that won't work.

    Thanks in advance for any help.
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade gradient text design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    I guess you will need to create a Wordpress shortcode to display your data & insert it in a Divi text module or code module.

    I don't have any other comments on that. If you want, you may refer official Divi support as well & see what they say: https://www.elegantthemes.com/members-area/help/
     
  3. Chalkie

    Chalkie New Member

    I actually managed to make it work by creating a dummy page with 1 row styled how i like it. I then copied the source code, and used a function to generate the page. I then created a blank page and just called the function and voila it was dragging the data down and styled.

    To generate a new 3 part row each time i used an increasing integer and just used "if(($i % 3) == 0)" to close and reopen a new row.

    There was a couple of extra checks but that was the basics.

    I then just included the styling section at the bottom of the function and it styled it perfectly.

    I think I was stuck because I couldn't enter anything into the section without a row, but bypassing that in the builder and just using it in the function made it work.
     
    fmzz1976 likes this.
    1. PRO MEMBER PERKS Divi.Help One-Page Layouts - Beautifully crafted one-page Divi layouts just for you:View All Layouts
  4. fmzz1976

    fmzz1976 New Member

    Hi Chalkie! Many thanks for sharing your case. I am working on a website for a Cinema that uses a management software that automatically updates an external json (url) :( Is it possibile to take a look to your website that use the external json file just for study it ? Many thanks! Please, if you want send me the url privately let me know.
    Best regards