Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter WidiGMX

    (@widigmx)

    It seems that this problem is not relevant. I thought there should be ready-made solutions. Now I have experimented myself and found the following solution.

    There is an undocumented (or poorly documented) feature in the PODS shortcode: The “join” attribute can be used to introduce a SQL fragment that is inserted at the appropriate place in the SQL query. This replaces the previously nested SQL query.

    Joins via table wp_term_taxonomy to the table wp_terms take you to the parent category.

    So, I have added a corresponding join clause:

    join="LEFT JOIN wp_term_taxonomy AS a ON cuisine.term_id=a.term_id
          LEFT JOIN wp_terms AS q ON a.parent=q.term_id"

    changed my where clause:

    where="cuisine.term_id and q.slug='european'"

    where the fragment cuisine.term_id ensures that the field cuisine is available in the SQL query.

    Regards Friedbert

    Hi @apollolux,

    I don’t know, whether you have found a solution so long. Since I was faced with the same problem, I experimented a bit.
    My solution: the where clause cannot check whether the parent of the current taxanomy term points to the category you are looking for.
    Instead, they should check whether the current term is a member of the set of all child terms of the category.

    where="placement.term_id in (SELECT b.term_id FROM wp_terms a JOIN wp_term_taxonomy b ON a.term_id=b.parent WHERE a.slug='featured')"

    Regards,
    Friedbert

    Thread Starter WidiGMX

    (@widigmx)

    Hi @keraweb,

    Yes, I know that′s the standard way, and yes that′s simple and working
    But then the terms of the taxonomy are listed in the order given by the taxonomy.
    I, on the other hand, don’t want to think of the terms as an unordered set. Rather, I want to prioritize or order the list of taxonomy terms individually for each entry of the custom post type.

    • This reply was modified 4 years, 1 month ago by WidiGMX.
    Thread Starter WidiGMX

    (@widigmx)

    Thanks for the hint. Yes, that already works partionally. The tagcloud widget in the admin interface disappears. But, unfortunately, the menu entry at the previously associated post type also disappears.

    Example: We have a Custom Post Type “person” (label.singular=”Person”, label.plural=”Personen”).
    Then we defined a taxonomy “ausbildung” (label.singular=”Ausbildung”, label.plural=”Ausbildungen”). To each person we want to assign several educations (qualifications). We want to sort the order of the educations for each person according to their priorities. Therefore, we do not use the taxonomy as an associated taxonomy, but as a relationship data field with multiple selection, where we can change the order.

    Until now, the admin menu shows the menu item “Personen” with the submenu item “Ausbildungen” to edit this taxonomy. That disappeared now too.

    Now I have tried to use the options “Admin UI” of the taxonomy “ausbildung” to place this menu entry again under the menu item “Personen”. But unfortunately unsuccessfully.
    If I set Menu Name=”Ausbildungen” and Menu Location=”Add a submenu item to Settings menu”, then it appears as expected in the Settings menu.
    Any attempts with Menu Location=”Add a submenu item to another menu” to place this item back to the menu item “Personen” menu failed. What do I have to enter in Custom Menu Location? The attempts with “Personen”, “Person”, “person” or “posts-person” were not successful so far.

    Regards, Friedbert

    Thread Starter WidiGMX

    (@widigmx)

    Ohh – I forget to mention that I talk about the input form in the backend (Admin UI) – sorry.
    We use custom post types (Pods) to store the master data of our workers or products. The problem described above occurs when we edit one of these items in the backend (admin UI).

    An example: We have specified the following data structure.

    • A taxanomy “CustTaxColors” with the items { Black, Blue, Gold, Green, Red, White, Yellow }.
    • A custom post type “CustPostFlags” with two custom fields “Flag Colors”, “Other Colors”, where both references the taxanomy “CustTaxColors” (multiple select).

    Now we use the admin dashboard to create a new entry of “CustomPostFlags”. The section “More Fields” shows the two fields (“Flag Colors”, “Other Colors”) where we can choose the items of the taxanomy. But there is also a single widget named “CustTaxColors” on the sidebar where we can select the items using checkboxes. The selection within this widget is not related to the data of the data fields. That’s confusing!

    Is it possible to hide this widget in the admin UI?
    Or is it possible to use two of these tagcloud widgets instead of the simple input fields.

    Regards,
    Friedbert

    Thread Starter WidiGMX

    (@widigmx)

    Hello Samuel,
    ok, I will let you know as soon as a solution becomes apparent.
    The approach via Gravity Forms you suggested sounds very exciting. I will keep that in mind for corresponding projects.
    The current project, however, is a website for a non-profit hiking club. I can’t use a commercial product from external service providers there.

    Thanks and regards,
    Friedbert

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