• Resolved galeo

    (@galeo)


    Hi there,

    I followed a tutorial on the PODS framework and created a custom post type called ‘product’ with four fields “info”, “weight”, “price” and “images”, and three different products.

    Then I created two templates, one for each individual product and another for a list of products. On the ‘product’ archive page, I choiced in the list template ‘images’ and ‘price’ fields. I tried to create a link from the image to the product detail page using the following code

    [each immagini]    
    <p class="immagini--prodotto"><a href="{@post_parent,get_the_permalink}"><img src="{@guid}"></a></p>
    [/each]

    by following the instructions in the tutorial. The link, however, points to a page that doesn’t exist.

    Furthermore, I noticed in the wp_posts table, in the post_parent field, an index value ‘14’, which is passed to the URL, creating the link to the page that does not exist, as mentioned earlier. In the tutorial, the link seems to work. Unfortunately, I have tried several times without success…

    I’ve seen what’s have been written at the page https://docs.pods.io/displaying-pods/image-media-fields-reference/ and I think the tutorial refers to this page. But I think that’s no longer the case, or am I wrong?

    Thank you in advance,

    Claudio

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support pd

    (@pdclark)

    If 14 is the ID for the correct post which the link should go to, for your post type product, then verify you have configured the post type to use the default WordPress permalink structure and templates:

    In Pods “Advanced Options” tab for the post type: “Public” and “Publicly Queryable” should be checked. This would usually be the cause of a 404. You may also need to save Permalinks in WP Admin > Settings > Permalinks after changing this.

    Thread Starter galeo

    (@galeo)

    Thank you @pdclark,

    I followed your instructions. The default WordPress permalink structure and templates is configured, in Pods “Advanced Options” tab for the post type, “Public” and “Publicly Queryable” are checked.

    Now, I’m looking for an explanation. In the table wp_posts ID 14 corresponds to the ID of the form used to create the three ‘products’. This ID is the same as the one that appears in the ‘post_parent’ field for product posts and their associated images. And it’s the same I see in the 404 URL http://podslab.local/prodotto/14 when I try to click on the image on the archive page with the three products.

    On the other hand, the link in the title of each individual product is correct and leads to the product details page http://podslab.local/prodotto/vecchi-libri/.

    I don’t understand…

     

    Thread Starter galeo

    (@galeo)

    I verified making another kind of content.

    I created other three objects with another “pods” through a form. In the “post_parent” field every record made with the form (text or images) have taken the ID of the form, as in the previous example. In the archive page the URL generated with the magic tags @post_parent on the images ends with that ID, but the link leads to a page that does not exist.

    It’s a real brain-teaser…

    Plugin Support pd

    (@pdclark)

    Are you using the form="1" attribute of the pods shortcode? See https://docs.pods.io/displaying-pods/pods-shortcode/

    Thread Starter galeo

    (@galeo)

    No, I’m not using it… I created the form using the menu New page > Control panel > Pods form. I don’t use shortcode in this case.

    Plugin Support pd

    (@pdclark)

    So you are using the Pods Form block, not a third party form? And it is set to create a new post object, not edit the current page? Try again with shortcode explicitly specifying creation of your target post type (Pod name), or join the plugin support Slack channel, where more detailed code can be shared for the multi-step workflow

    Thread Starter galeo

    (@galeo)

    Thank you so mutch @pdclark,

    now I’m sure I’ll use the Pods Form block, not a third party form.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.