Skip Navigation

[Resolved] cant get correct… waqas please

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1445509

ill do my best to explain....
so this page here on my site (which is a judge page hidden link if you scroll down and press View Miss A Hayes Trial Judging Results. (1st epandable box) you will see you will see the 1ST PLACE BOX all info in there is correct , the 2nd 3rd etc there is no data input yet.
as you can see for the 2nd 3rd etc place for the kennel afix it is sowing all kc affixes (there should be none as they havnt been entered)

ok so here is how it works
owner has a relationship to judges ,judges has its custom fields and judges has a relationship to kc affix.

my theme template calls " view to show all events related to a judge" here hidden link

this in turn calls "view to show a dog on a judge child" here hidden link

this in turn calls "view to show a owner on a dog child" here hidden link

this in turn calls "affix on dam under places" here hidden link

for instance 2 nd place owner is j luxford is not yet connected to a judge , so no info should be displayed.(except labels with no info)

thnk you waqas....... sorry for thr complicated issue.... i have same issue for handler ,breeder,sire and dam but hoping as they are all set up identical i sort them wheen this owner 1 is fixed!

you must be logged in to see the page.

#1446433

Hi Martin,

Thanks for asking! I'd be happy to help.

I've thoroughly reviewed your requirement and the current set up of views used on a single "judge" page, and I'm afraid, they are different from each other.

In summary,
a). From a judge, you reach to events connected to the current judge.
( view: View to show all events related to a judge )

b). From an event, you reach to dogs connected to the current event.
( view: view to show a dog on a judge child )

c). From a dog, you reach to an owner connected to the current dog.
( view: view to show a owner on a dog child )

d). From an owner, you're trying to reach to a Kennel Club Affix's connected to the current owner.
( view: affix on dam under places )

It is important to note here that "owner: James Luxford" is appearing on that page not on the basis of relationship with the judge but because it is connected to the dog "Whiznic Waterwynch Of Howesyke".

I also found two "many-to-many" relationships exist between "Judges" and "Owners", whereas only one should be enough:
a). Judges Owners
b). Owners Judges

My recommendation would be to only keep one of those relationships and delete the extra one. After that please let me know exactly which item/information should be removed from each "dog with a position block in the event" on the single judge's page and I'll be in a better position to guide you accordingly.
( it would also help if you could actually connect at least one owner to this judge "Miss A Hayes" )

regards,
Waqar

#1446505

than you waqas
judges owner is now gone
judge a hayes is now connected to the owner a hayes test owner and judge a hayes is now connected to kc affix a hayes test affix

many thanks

#1448507

Hi Martin,

Thanks for the update.

From reviewing how the "affix on dam under places" view was being called in the "view to show a owner on a dog child" view, it needed a conditional check, to only call the nested view, when the "[wpv-post-id item='@owner-judge.child']" is not empty and actually brings in a judge's ID.

Instead of directly calling the nested view, I've wrapped it in a conditional block:
( ref: https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/ )


[wpv-conditional if="( '[wpv-post-id item='@owner-judge.child']' ne '' )"] 
<strong>[wpv-view name="affix-on-dam-under-places" wpvrelatedto="[wpv-post-id item='@owner-judge.child']"]</strong>
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-id item='@owner-judge.child']' eq '' )"] 
<strong>Kc Affix :</strong>
[/wpv-conditional]

When the nested view was being called without any judges ID, it was showing all the "Kennel Club Affix's" posts, which is not what you wanted.

The same logic can be applied in your other nested views too, where you're having the same challenge.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1448613

waqas you simply are just "THE MAN" thank you ever so much as usual......ill leave open while i just sort the others in case i struggle
thanks again!!

#1448679

waqas just a quick one , what you have done is exactly what i required , would it be difficult to implement the following :

if owner has no field attached it shows "Info Required"
if judge has no field attached it shows "Info Required"
if Judge has no custom field info it shows "Info Required"
if judge has no KC AFFIX attached it shows "Info Required"

if this is a lot of work i can more than live with how it is currently after your awesome work!

thankyou waqas

#1450097

You're very welcome and glad that my messages helped.

In the view "view to show a owner on a dog child", you'll note there are two conditional blocks.
( screenshot: hidden link )

The first one is for the case, where a post ID of a connected judge post exists and we load the child view's output.

The second one is for the case, where no post ID of connected judge post exists and we simply show a static message:


<strong>Kc Affix :</strong>

To include "Info Required" text, you can update it to:


<strong>Kc Affix : Info Required</strong>

The same logic can be applied to other fields, as well. For example, owner info is shown as:


Owner: [wpv-post-link item="@owner-judge.child"]

And it can be updated to be wrapped in conditional blocks as:


[wpv-conditional if="( '[wpv-post-link item='@owner-judge.child']' ne '' )"] 
Owner: [wpv-post-link item='@owner-judge.child']
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-link item='@owner-judge.child']' eq '' )"] 
Owner: Info Required 
[/wpv-conditional]

regards,
Waqar

#1455025

sorry waqas i think i may of explained poorly , if the owner has no relationships to show it simply does not dispay anything atall , for all the fields and the labels.

#1455399

If you don't want to show the empty field labels, you can use only the first part of the conditional blocks from my examples and not the second one.

As explained in the last message, the first conditional block is for when a value exists and the second one is for when no value exists.

#1455847

to say im confused is an understatement.... i don't think i explained very well.

on the owner (forget handler etc) i have the 4 views as in the 1st post.

as it is now it shows when it has a relationship attached correctly like so

Owner: Barnes L , Judge Status NP:2551
Kc Affix : test 8

now if no owner is found i would like it to show

Owner: info required (as it can not display the next fields as nothing connected) and nothing else . which of the 4 templates would i edit

if i use the example you gave me and just use

[wpv-conditional if="( '[wpv-post-link item='@owner-judge.child']' ne '' )"]
Owner: [wpv-post-link item='@owner-judge.child']
[/wpv-conditional]

in the view hidden link then it hides the kc affix field when no data.

sorry waqas

#1456083

No worries and I'll be happy to help.

Can you please refer to this screenshot, to confirm if I've understood the requirement correctly?
Screenshot: hidden link

If my understanding is correct, you can move the other fields in the conditional code block below too:
( screenshot: hidden link )


[wpv-conditional if="( '[wpv-post-id item='@owner-judge.child']' ne '' )"]
<strong>Owner: [wpv-post-link item="@owner-judge.child"] , Judge Status  [types field='panel-for-judge' item='@owner-judge.child'][/types]:[types field='judge-book-number' item='@owner-judge.child'][/types]</strong>
<strong>[wpv-view name="affix-on-dam-under-places" wpvrelatedto="[wpv-post-id item='@owner-judge.child']"]</strong>
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-id item='@owner-judge.child']' eq '' )"] 
<strong>Owner: info required</strong>
[/wpv-conditional]

#1456921
waqar.png
waqar.jpg

fabulous waqar , its done exactly what you said! now the final piece to the whole puzzle .
i have attached a screen shot to show what i mean ,
(please note
so i have my owner set , he it attached to my judge , the judge has all his custom fields set . so the screen shot shows correct ,

HOWEVER in the screen shot it shows info requires for the kc affix as this judge has no kc affix , can i make this show
KC Affix : Info Required .

the creen shot is from hidden link
many many thanks you are an awesome support man so very helpful.

#1457175

Glad I could help.

Those particular "no items found" text is coming from the "Loop Editor" section of the view "affix on dam under places".
( screenshot: hidden link )

You can update that text to "KC Affix : Info Required" from there.

#1461849

brilliant thanks waqas it did just the trick !!! many many thanks!

#1461851

My issue is resolved now. Thank you!