• Resolved djdefenda

    (@djdefenda)


    Hi,

    Firstly, Pods is amazing! Thank You!

    I have a question referring to the metaboxes that appear on the side of the editing screen for a single post. Here is a screenshot;

    View post on imgur.com

    I have created a Custom Post Type that is ‘Artists’ and then I have Custom Taxonomies such as ‘Topics’ and ‘Skills.’

    The screenshot shows the editing screen for the Custom Post Type ‘Artist.’

    After I created the Taxonomy ‘States’ it appears twice in the editing screen; once on the left, and then once on the right, in the metabox.

    Initially, I assumed they were connected and I could use either one but I have noticed they don’t work like that. In the link provided you can see that no Artists appear on the page, even though the screenshot shows the ‘State’ Taxonomy is marked ‘South Australia.’

    If I use the metabox on the right, the post will then appear on the page for the State ‘South Australia’ but it does not update the box on the left.

    I am thinking that I have set things up the wrong way and it would be great to get some guidance.

    Thank You

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    The only way it would show up on the left is if you created a relationship to that taxonomy. You don’t need to do that (and we don’t recommend it). They are not connected; they are considered two entirely different connections (a relationship to a taxonomy is not the same thing as an associated taxonomy).

    We only use relationships to taxonomy if you don’t need them to show up in the taxonomy archives or if you’re using Advanced Content Types which didn’t support taxonomy natively. We don’t recommend creating a relationship field to taxonomies for Custom Post Types, because it will give you the exact same weird results you’re seeing. Associating a Taxonomy is the correct way to deal with Taxonomy.

    Thread Starter djdefenda

    (@djdefenda)

    Ok, firstly, I am a bit unsure what the difference is between a relationship and an association with a custom post type…..

    For a temporary solution, I used the wordpress screen options to make the metaboxes on the left hidden from view.

    My custom post type is ‘Artists’

    I created a custom taxonomy named ‘states’

    I created a field under ‘Artists’ that has a relationship to the ‘states’ taxonomy, and it is bi-directional.

    I created a field under ‘states’ that has a relationship to the ‘artists’ post type and that too is bi-directional.

    I made a template for the custom post type ‘artists’ as you can see on the published page here;
    https://aushiphop.dribbles.com.au/artist/dj-debris/

    Within that page, it correctly shows the link and title to the ‘state’ taxonomy. In this case, it says “South Australia”

    I then made a template for the custom taxonomy ‘states’ but when clicking on the link to that state, it displays a blank page.

    Here is the link;
    https://aushiphop.dribbles.com.au/state/south-australia/

    I watched one of your online tutorials last night – more terrific work, so many thanks ?? – and the Hairdresser example had a setup in what I thought was the same as mine so I am confused what you mean when you say “We don’t recommend creating a relationship field to taxonomies for Custom Post Types”

    Plugin Contributor Jim True

    (@jimtrue)

    Associating a post-type with a Taxonomy is from this tutorial (https://pods.io/docs/build/how-to-associate-a-post-type-with-a-taxonomy/); it sounds like you already did this or the metaboxes for the Taxonomies would not be in the right side of your post editor screens. This input is what is required for your ‘States’ to work the way Categories & Tags works. This is what a taxonomy does: it organizes content, filtering and grouping it across multiple post-types.

    Relationships are used when you want to make direct connections between different pieces of content. Books and Authors, Albums and Artists, Stylists and Services they perform, that sort of thing. Content-wise, it usually means you have one page that you want to present with either types of the content at both sides of the relationship, so they can represent a singular item.

    Taxonomies, on the other-hand, are usually only represented in your content as ‘groups’ of other things. States where artists are located, genre of books or movies, etc.

    What I meant by you’re confusing relationship and taxonomy is: you’ve created a relationship field to the taxonomy and you can’t do that and use it to populate the taxonomy. They aren’t the same field, which is why your state/south-australia isn’t working because you’re entering the data in the relationship field and not the taxonomy.

    If, in your configuration, you are planning on having States have their own unique pages with information, then create it as a Custom Post Type and just create a relationship between the artists and the State and get rid of the Taxonomy.

    A lot of people are confused by taxonomies and relationships because WordPress doesn’t have relationships so they treat their taxonomies like relationships, but they’re not the same thing and they don’t behave the same way in WordPress.

    The problem you’re having is that you have confused them and have two fields to represent them. You either need to: 1) stick with States as Taxonomy and delete your relationship field to States and only use the right hand metabox for State connections, or 2) delete the Taxonomy States and create a Custom Post Type for States and create a relationship field between artists and states.

    Plugin Contributor Jim True

    (@jimtrue)

    This video might help about Planning your Content before you build it:

    Thread Starter djdefenda

    (@djdefenda)

    Very thorough answer, helped me to explain many things, thank you.

    I am unsure if it is related to Pods, but I didn’t do many things to my site except delete all those taxonomies and replace them with custom post types but now I constantly get this error message;

    “”One or more database tables are unavailable. The database may need to be repaired.””

    I was wondering if you have encountered this problem in relation to Pods before?

    I have tried swapping my cache plugin with Pods alternative cache, tried using both, tried none, tried repairing and optimizing the databse but nothing seems to work. The error now appears on all my domains, even tho I was not working on them!

    Thank You

    Plugin Contributor Jim True

    (@jimtrue)

    All your domains? Are they all on the same host? I’d escalate to your hosting company. Nope, I’ve never seen that issue but typically when I’ve made some bad decisions in my structure, it’s easier to just drop the database tables and start over ??

    Thread Starter djdefenda

    (@djdefenda)

    It was a server problem – there was an issue with ‘Imunifu360’ locking up the database.

    Thought I’d post the answer for future reference in case anyone searches for it ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Metaboxes & Fields’ is closed to new replies.