#128075 Linking 2 post types dynamically

Landing Forums JupiterX WordPress Theme Linking 2 post types dynamically

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • Marc Eggleton

    Hi there,

    We are currently in the process of redesigning one of our clients website and using jetengine to create a few post types.

    With that said, we need to link up 2 post types so that there is a relationship between the 2. if you look at this page on their existing site you should be able to see what i mean: https://www.somersetartgallerytrust.co.uk/artists/elizabeth-adams/

    If you look at the bottom of the artist profile you can see projects which are only related to the specific artist. I can’t figure out how we can create that relationship between the 2 post types and have been trying to figure out a workaround with no success.

    So essentially, there needs to be a field on the project post type that allows us to select an artist. we then need to be able to use this to display a grid of project posts at the bottom of that artists profile – the projects also need to link back to the artist.

    Here is a link to an artist profile on our site: https://sagt.dexdesdev.co.uk/artists/elizabeth-adams/
    and also to a project that is related to the artists: https://sagt.dexdesdev.co.uk/projects/elizabeth-adams-pointes-retired/

    Any help here would be much appreciated.

    Tatyana Hutsol Support Team

    Hello,

     

    I think you should create a listing in JetEngine > Listing Grid and add the content for projects.

    Then in the Single template, add Listing Grid element and select a custom post type in the settings https://prnt.sc/1j1ek9d .

    I suppose it should work for your needs.

    Please try and let us know the result.

     

    Regards.

    Marc Eggleton

    Hi there,

    This does enable us to have the grid at the bottom of the artists profile but it doesnt quite fix the issue. if you look at any artists item now you will see the same projects, even though the projects need to be specific to certain artists.

    If you look at Pat Preater for example (here: https://sagt.dexdesdev.co.uk/artists/pat-preater/) you will see that it is showing a project by Elizabeth Adams (here: https://sagt.dexdesdev.co.uk/artists/elizabeth-adams/) we need the projects to work so that i can assign a project to one of the artists and therefore it will only display projects from that artists. Does that make sense?

    You can see the functionality of this on their current live site here: https://www.somersetartgallerytrust.co.uk/artists/
    If you click on any artist, you will see that the projects are different for each one because they have been set in the backend to do so. So, essentially, there needs to be a field in the backend of the project post type that enables you to select one of the artists, and then some way to enable this within the Grid Listing element.

    Please let me know how we would go about doing this.

    Kind regards.

    Tatyana Hutsol Support Team

    Hello,

     

    You see the Elizabeth’s project because it’s the only project that’s created https://prnt.sc/1q9siji .

    Please add more projects for each artist and check the result.

     

    Regards.

    Marc Eggleton

    Hello,

    It doesnt quite work like that though, which is the issue i am trying to get across.

    If you now look at any artist you will see that it shows all projects – not projects specific to a certain artist (example of Jane stott showing projects by hilary adair and elizabeth adams: https://sagt.dexdesdev.co.uk/artists/jane-stott/). this is because there is nothing linking the artists and the projects together. the listing grid is set up to display all projects, so we need to find a way of making it show only projects specific to that artist.

    Is there not a meta field or taxonomy that we can add to the project post type that will display a list of artists? we can then select an artist from the backend of the project and somehow configure the listing grid to only show projects that are assigned to that artist?

    I’m not sure if i can explain it any better than this so hopefully we can get to the bottom of this.

    Thanks.

    Tatyana Hutsol Support Team

    Hello,

     

    You need to create Post Relations in JetEngine:

    https://crocoblock.com/knowledge-base/articles/how-to-choose-the-needed-post-relations-and-set-them-with-jetengine-plugin/

    Thank you.

     

    Regards.

    Marc Eggleton

    Hello,

    That seems to have done the trick! thanks for the help.

    Just one other minor thing i am struggling with – we have added a meta field to the artists so that we can add an external url that will link to their websites. i have added the dynamic link element to the artist listing but for some reason it is button the full url as a prefix to the website url.

    For example, the button on Pat Preater (https://sagt.dexdesdev.co.uk/artists/pat-preater/) links to https://sagt.dexdesdev.co.uk/artists/pat-preater/ipreater.co.uk/pat-preater/ whereas it should just be ipreater.co.uk/pat-preater/

    could you let me know how we can go about removing the url prefix from this? i have played around with the dynamic link settings but cant figure it out. i also checked the documentation here: https://crocoblock.com/knowledge-base/articles/jetengine-dynamic-link-block-overview/

    Many thanks.

    Tatyana Hutsol Support Team

    Hello,

     

    Could you clarify where you added the website URL?

    I see only “Email” field in the Artists post editor https://prnt.sc/1qbkt7j .

    Looking forward to hearing from you.

     

    Regards.

    Marc Eggleton

    Hello,

    I have managed to counteract this by ensuring that the full url is on display. previously it was just ipreater.co.uk/pat-preater/ so by adding http:/ to the beginning it is now being picked up as a url instead.

    Kind regards.

    Tatyana Hutsol Support Team

    Hello,

     

    Glad to hear it!

    Thanks for informing.

     

    Regards.

Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic.
Login