Hello,
we built a frontend page where our customer can list and edit Repeatable Fields Group.
In this page we show the main page title with [wpv-post-link item="[wpv-search-term param='wpv-relationship-filter']"]:
This is working well, so we get the post title (the room name) of the CPT ROOM.
This CPT has a relationship with the CPT HOTEL, so a single hotel can have more than 1 rooms and every room is owned by just one hotel.
What we need is print the hotel name, so we will have: HOTEL NAME > ROOM NAME.
Is this possible?
Thanks a lot!
Hi,
Thank you for contacting us and I'd be happy to assist.
To suggest the best way to achieve this, I'll need to see how this page is set up in the admin area.
Can you please share temporary admin login details along with the link to a page where you'd like to show the parent hotel name/title?
Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.
regards,
Waqar
Hello, thanks for the reply.
This is the link of a demo website your support collegue created for another problem:
versteckter Link
I have added a CPT Hotels and a CPT Rooms;
I have created a HOTEL post named Lorem Ipsum and assigned a ROOM post named My Windy Room:
versteckter Link
My Windy Room has a RFG and this is the frontend page where edit it:
versteckter Link
This page shows the ROOM page title by using this shortcode [wpv-post-link item="[wpv-search-term param='wpv-relationship-filter']"]
What we need is to also show the HOTEL NAME, so it should be print this:
Hotel Lorem Ipsum // My Windy Room
Thank you for sharing these details.
Just as you're passing the ID of the parent "Room" post in the URL attribute "wpv-relationship-filter", you can also include the ID of the grandparent "Hotel" post in the URL attribute "hotel-id".
The updated link for the edit RFG page will look like this:
<a href="/edit-rfg-items-page/?wpv-relationship-filter=[wpv-post-id]&hotel-id=[wpv-post-id item='@hotel-room.parent']"> Edit RFG </a>
And then you can update the heading in the edit RFG page to include the hotel link, like this:
<h1> [wpv-post-link item="[wpv-search-term param='hotel-id']"] // [wpv-post-link item="[wpv-search-term param='wpv-relationship-filter']"] </h1>