Giter Club home page Giter Club logo

Comments (4)

PaulBratslavsky avatar PaulBratslavsky commented on September 26, 2024 1

@kaloyan-dimov did you add a new field to features component that is referencing the image.

At the moment features component does not have an image field.

Here is what it looks like.

Screenshot 2024-04-11 at 12 11 50 PM

If you made changes to it, can you show me what it look like. It will help me better help you.

Based on you code:

    features: {
        populate: {
            background_picture: {
                fields: ["url", "alternativeText", "caption", "width", "height"],
            },
        },
    },
    

You are trying to populate a field called background_picture but this field does not exist in the features component, unless you added it your self.

If so, show me what the fields look like, and I will help you figure out how to update the query.

from nextjs-corporate-starter.

kaloyan-dimov avatar kaloyan-dimov commented on September 26, 2024 1

@PaulBratslavsky

Yeah that was added there previously, turns out I wasn't populating the image properly in page-populate-middleware.js:

The way it works is:

const populate = {
    contentSections: {
        populate: {
            picture: {
                fields: ["url", "alternativeText", "caption", "width", "height"],
            },
            buttons: {
                populate: true,
            },
            feature: {
                populate: {
                    fields: ["title", "description", "showLink", "newTab", "url", "text"],
                    media: {
                        fields: ["url", "alternativeText", "caption", "width", "height"],
                    },          
                    media2: {
                        fields: ["url", "alternativeText", "caption", "width", "height"],
                    },
                },
            },      
            background_picture: {
                fields: ["url", "alternativeText", "caption", "width", "height"],
            },

This somehow helps the builder populate the picture in the section included in the flexible content (I presume this code would allow all fields in all sections with the name background_picture)

Thanks for the swift reply and let me know if populating here can be done in a better way.

from nextjs-corporate-starter.

PaulBratslavsky avatar PaulBratslavsky commented on September 26, 2024

Glad you got it working.

from nextjs-corporate-starter.

PaulBratslavsky avatar PaulBratslavsky commented on September 26, 2024

I am going to close this, but let me know if you run into any other issues.

from nextjs-corporate-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.