Skip Navigation

[Resolved] 2nd view single field block in template showing in preview but not on front-end

This support ticket is created 4 years, 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by matthewC-10 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1922859
Screenshot 2021-01-29 at 10.51.46.png
Screenshot 2021-01-29 at 10.51.23.png

Tell us what you are trying to do?

2 things:

FIRST
I have created the following post-types:
Community (and Sub-Community)
Ministry
Persons

A community is made up of persons and the person in charge of the community is *overall* responsible for the ministry. Each person in the community is assigned to a ministry with one of them being responsible for the ministry. The person who is responsible I'd like to display first in the list of people of either the community or the ministry.

Each ministry has people assigned to it. On the template page I'd like to list 3 things:
1) the people assigned to it (with the person responsible being first) and the others alphabetical by surname.
2) I'd like to also list which community the ministry falls under.
3) And I'd like to show a map of the location of the ministry.

I have been able to do 1 and 3, and although 2 shows up in preview, it is blank on the front-end.

I have created the following relationships:
* Missions - a many-to-many relationship of Ministries and Persons, i.e. many persons are missioned to many ministries, i.e. a ministry can have 1 person, or it can have many people. And 1 person can be missioned to 1 or many ministries.
* Dependent works - a one-to-many relationship of Communities and Ministries, i.e. 1 Community can have many Ministries, and 1 Ministry can only belong to 1 Community.

I'd similarly like to do the same for the community template, i.e. show which persons are assigned to it, and where they work.

And perhaps even the person template, show which community they are in and where they work.

It's complicated that there is also a sub-community, so a person can belong to a Community or at a different location a Sub-community (and the community has a 1 to many relationship with sub-communities) (so a person will only belong to a community OR a sub-community, but I need to list sub-communities under communities).

What I do not understand is I've created a view using for content selection the relationship Missions intermediary posts and inserting a single field dynamically sourcing it from standard field Parent:Community's Post Title... and it shows up in the block editor, but when I save the page and view it on the front end it shows a blank?

What is the link to your site?

The site is currently in development hidden link

The other relationships are:
Cities Communities => Cities [0 .. 1] << Communities [*]
Cities Ministries => Cities [0 .. 1] << Ministries [*]
Commissions Persons => Commissions [*] << Commissions Persons >> Persons [*]
Community members => Communities [0 .. 1] << Persons [*]
Conferences Provinces => Conferences [0 .. 1] << Provinces [*]
Countries States => Countries [0 .. 1] << States [*]
Dependent Communities => Communities [0 .. 1] << Sub-Communities [*]
Dependent Works => Communities [0 .. 1] << Ministries [*]
Locations Conferences => Locations [0 .. 1] << Conferences [*]
Locations Countries => Locations [0 .. 1] << Countries [*]
Missions => Ministries [*] << Missions >> Persons [*]
Provinces Countries => Provinces [0 .. 1] << Countries [*]
States Cities => States [0 .. 1] << Cities [*]
Sub-Communities Persons => Sub-Communities [0 .. 1] << Persons [*]

SECOND:
I had wanted to create a select box as a custom field in e.g. Community that would read the values of the custom post-type City etc. (and do the same for State, Country, Conference and Location) so that I could later search Ministries, Communities, Sub-Communities, by Country, State, City, etc. But I found I had to create a text field and type the city in manually, in order to display the City as a text on the template - i.e. I could not find out how to display the city via the relationship...

#1922895

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To display the parent field, you will require to select the parent source of the field.

Please check the following screenshot: hidden link

Can you please select the post soruce from "Current post" to parent, you will find within the dropdown. Can you please check if that help you to resolve your issue.

#1922939
Screenshot 2021-01-29 at 11.50.25.png

Hello,

I currently have it selected as Standard Field -> Parent: Community -> Post Title

As I said above, it displays in the editor - but not in the front-end, see the earlier two images.

#1922955

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - Can you please share problem URL where I can see the issue as well as access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1923017

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

To display only the related parent post title you will not required the view. So, I've removed the view you added to display the community and instead added the single field block. Please check the following screenshot:
=> hidden link

#1923027

Thank you. It appears to be working. May I ask then, when does one require a view?

#1923041

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You will require view, for example, when you want to display list of posts, for instance: related child posts.

As with one-to-many post relationship, you can display the related single parent using single field block, to display related child posts (many) you will require view.

#1923049

My issue is resolved now. Thank you!