Skip Navigation

[Resolved] Loading post parent in a third party plugin

This support ticket is created 3 years, 8 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 16 replies, has 2 voices.

Last updated by Shane 3 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#1989315
Screenshot 2021-03-16 at 16.43.02.png

Hi

I would like to be able to load the posts parent's post title in the Favourites plugin.

I have attached a screenshot of how the setup works on this plugin, you can easily load in custom fields.

However I don't think the post parent's post title is stored in a custom field?

Would creating a view and passing some information from a custom field be best here? Would a view even work here?

Is there a better more elegant solution for this?

Thanks

#1989621

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Matthew,

Thank you for getting in touch.
However I don't think the post parent's post title is stored in a custom field?

If the using [wpv-post-title] returns the correct post title of current post then you should be able to get the correct parent title by following this concept using the item attribute using the format @{relationship-slug}.{relationship-role}
https://toolset.com/documentation/user-guides/views-shortcodes/item-attribute/

However given that you are using the $parent value instead i'm assuming that this is a hierarchical post type relationship ?

Please let me know.
Thanks,
Shane

#1990275

Hi

Using [wpv-post-title] returns the page title not the specific CPT post name for the favourite row.

Basically this is the customisation for each row, when showing a users favourites.

I thought maybe we could pass the Toolset shortcode an ID to tell it which post title to show instead? Since the Toolset plugin can't figure it out at the moment?

I realise we can use attribute item to pass the ID, problem is Favorites doesn't let us pass the ID only the post title.

Regarding the relationship I am using a one to many. I guess id probably decsribe it as a hierarchical relationship (I am not sure if this is an actual setting though?). It involves just 2 post types.

The plugin I am specifically using is hidden link - its been suggested a few times on Toolset forums as an option for managing user favourites. Curious if this questions ever been asked but I couldn't find anything on it.

Cheers

#1990277

Hi

Using [wpv-post-title] returns the page title not the specific CPT post name for the favourite row.

Basically this is the customisation for each row, when showing a users favourites.

I thought maybe we could pass the Toolset shortcode an ID to tell it which post title to show instead? Since the Toolset plugin can't figure it out at the moment?

I realise we can use attribute item to pass the ID, problem is Favorites doesn't let us pass the ID only the post title.

Regarding the relationship I am using a one to many. I guess id probably decsribe it as a hierarchical relationship (I am not sure if this is an actual setting though?). It involves just 2 post types.

The plugin I am specifically using is hidden link - its been suggested a few times on Toolset forums as an option for managing user favourites. Curious if this questions ever been asked but I couldn't find anything on it.

Cheers

#1990279

Hi

Using [wpv-post-title] returns the page title not the specific CPT post name for the favourite row.

Basically this is the customisation for each row, when showing a users favourites.

I thought maybe we could pass the Toolset shortcode an ID to tell it which post title to show instead? Since the Toolset plugin can't figure it out at the moment?

I realise we can use attribute item to pass the ID, problem is Favorites doesn't let us pass the ID only the post title.

Regarding the relationship I am using a one to many. I guess id probably decsribe it as a hierarchical relationship (I am not sure if this is an actual setting though?). It involves just 2 post types.

The plugin I am specifically using is hidden link - its been suggested a few times on Toolset forums as an option for managing user favourites. Curious if this questions ever been asked but I couldn't find anything on it.

Cheers

#1990281

(sorry about the duplicate posts! I am not sure what was happening with the Toolset site but nothing was showing up)

#1990953

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Matthew,

Thanks for the further details. I understand now, the [wpv-post-title] shortcode is getting the ID of the current page rather that the post in the favourites.

You can manually pass the ID of the parent post into the shortcode but it won't be dynamic and I believe a similar issue will happen with using a view given that in order to filter correctly the view needs the correct ID however the Favourite post plugin isn't providing the ID for us to use instead we are getting the current page's ID.

Perhaps you can check with the team of the Favourite Post plugin to see if they have a way to get the id's of the posts that they are displaying.

If we get this then we may be able to use it to filter the view and get the parent post title.

Thanks,
Shane

#1992097

I did try contacting them but didn't get any response.

Is ther no way we can get the ID with the post title? As I can get this and pass this?

I can also get the post permalink, just not the ID. 🙁

There is a few people talking about this including people on Toolset forums but no one has posted a solution.

#1992285

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Matthew,

Perhaps if I had a look I can see how this is setup.

Can you provide me with admin access to the site so that I can have a look ?

Also please send a link to the post that you're testing this out.

Thanks,
Shane

#1997797

Hi

Sorry for the delay, yes of course. I have attached the login info.

You can get to the plugins config by going to Settings -> Favorites.

Thanks.

#1997823

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Matthew,

Can you disable the 2FA for the account that you've provided for me?

If not please let me know and I will set it up .

Thanks,
Shane

#1998003

Hi Shane,

No problem I think I have done this for you now 🙂

Thanks

#1999225

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Matthew,

Thank you I was able to get onto the site, what you need to let me know is how to get to the screen in your screenshot in the forum post below.
https://toolset.com/forums/topic/loading-post-parent-in-a-third-party-plugin/#post-1989315

As well as where on the frontend I can preview any changes that are made in the editor. This way I can work through to understand the flow of data on the plugin to see if there is a solution to the issue you are experience.

Thanks,
Shane

#2000927

Hi

No problem to get to the settings once logged in go here:
hidden link

Then go to "Listing Display" in the options and click "Settings" to customise it.

You can see the results here:
hidden link
(again need to be logged in)

This is a dev site so don't worry too much about changes you make.

Thanks.

#2001131

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-03-25 at 4.21.49 PM.png

Hi Matthew,

So I tried to add some text to the field, however the change is not being reflected on the frontend. See Screenshot.

Perhaps I am looking in the wrong place on the frontend. However when I modify the Clear List text this changes.

Is there something that I need to click on this page below to see my text reflect on the frontend?'
hidden link

Thanks,
Shane