How can i change permalink structure of room link ?
-
How can i change URL structure of room page like from example.com/double-rooms/?roomid=7 to example.com/double-rooms/new-room-slug
-
Hi,
Thanks for your message. The URL routing functions with VikBooking are handled directly by WordPress thanks to the Shortcodes you publish on your pages/posts.
In order to get the desired URL structure, it is sufficient to create a new Shortcode of type “Room Details”, and to select the corresponding room with ID 7. Such Shortcode will have to be used inside a WordPress page/post with its own title and slug, which will be used by VikBooking and its URL routing functions to obtain the exact permalink you want.
As you may know already, Shortcodes can be created through the apposite wp-admin page of VikBooking and immediately linked to a new WordPress page/post, or you can just create a new page/post through Gutenberb, and by choosing the block type “VikBooking Shortcode” you will be able to add the “Room Details” Shortcode to your new page with the desired title/slug.
We hope this helps!
The VikWP Team
Ok i added shortcode in page but i not need “example.com/double-rooms/?roomid=7” means room_id query parameter. I need slug like “example.com/double-rooms/new-room-slug”
Hi,
Yes, that’s correct. The URL routing functions of VikBooking will let you obtain the desired URL slug by removing the query-string value
roomid=7
as long as you have a Shortcode of type “Room Details” for the room with ID 7 connected to a page/post of your WordPress website.The most common setup for the Shortcodes among our clients is to have a page like your “/double-rooms” that uses a VikBooking Shortcode of type “Rooms List”, optionally with a category filter to show only your double rooms. Then, for each room-type that belongs to that category, you can create an apposite Shortcode of type “Room Details”, and by selecting the page “/double-rooms” as parent, you will get exactly a final URL like
/double-rooms/double-room-deluxe
rather than the non-rewritten URL with query string values.If you visit the page “Rooms List” on the official demo website of VikBooking, you will find 2/3 rooms that have a dedicated Shortcode of type “Room Details” which removes the query string values. For example the room called “Triple Deluxe” has got its own slug with a Shortcode connected to a parent Shortcode of type “Rooms List”. This is exactly the configuration you are looking for.
ok thanks
I created page with [vikbooking roomid=”3″ view=”roomdetails” lang=”*”] sortcode with page slug “double-rooms” but not see slug of room like “/double-rooms/double-room-deluxe”.
Let me know that how can i see details page URL on room list “View Details” button ?Hi,
If your room with ID 3 corresponds to the “Double Room Deluxe” and if such Shortcode has been used inside a page with the desired slug “double-room-deluxe”, then all you need to do is to assign the page “Double Rooms” as parent for the page “Double Room Deluxe”. This way the slug will be nested automatically by WordPress.
By creating the Shortcodes through the native functions of VikBooking, or through Gutenberg, you could have had the two pages automatically assigned as parent/children.
Basically, the first Shortcode of type “Rooms List” should have a name like “Double Rooms” and all the needed filters set. This should be a parent page and so you should just let the system generate a new page with this Shortcode inside. Then, you need another Shortcode of the type you just created, “Room Details”, and you should select the Shortcode “Double Rooms” as parent. This way the system will automatically create a new page called “Double Room Deluxe” with the page “Double Rooms” set as parent so that the URL will be the desired one.
I created page “double-rooms” with below sortcode
[vikbooking category_id=”1″ sortby=”name” sorttype=”asc” layoutstyle=”list” reslim=”20″ view=”roomslist” lang=”en-US”]
and then created “details” page with [vikbooking view=”roomdetails” lang=”*”]
and then set parent page “double-rooms” to “details” page.
But not working.
It created page url like “https://example.com/double-rooms/details/?roomid=6”- This reply was modified 5 months, 2 weeks ago by heena1.
The Shortcodes look fine, the “Room Details” Shortcode must contain the room ID attribute, but that must be correct if it was copied or added by VikBooking. As long as both Shortcodes are working by rendering the proper and respective pages, you just need to work on the parent-child page relations managed by WordPress. This is no longer a configuration you need to handle through VikBooking, because the URL routing functions are handled by WordPress itself.
It’s like if you wanted to create a nested article/post through the native WordPress functions for your website pages. The only difference here is that the two pages involved will contain the respective Shortcodes of VikBooking.
For this reason, you can just work on the page settings through WordPress and ensure the “Double Room Deluxe” page is using the page “Double Rooms” as parent and the URL will result in a nested slug.
Lastly, whenever you see a non-rewritten URL with query string values like
?roomid=6
it means VikBooking was unable to route the link to any existing page of that type, which is “Room Details” with room ID filter equal to 6. Also, your example URL shows that you have created a Shortcode on a page with slug/details
, and that should probably be removed (page + Shortcode).
- You must be logged in to reply to this topic.