PDA

View Full Version : Can I load listing-details page directly only knowing ID number?



Horizon
January 20, 2024, 07:44 AM
For example, the print page can be accessed via
/print.html?item=listing&id=815

Is there a way to similarly load a listing details page directly if I have only the listing id #?

(/listing-details.html?item=listing&id=815 doesn't work but I'm not sure if that syntax is correct)

Rudi
January 20, 2024, 09:25 AM
You can't do it directly because each system page has its controller (php and tpl file). For the listing details page it's listing_details

You can try to use content from listing_details.php and listing_details.tpl and adapt it to your case

Horizon
January 20, 2024, 05:09 PM
The rewrite is complicated for me, but it looks like the default rewrite of a listing details url is to index.php as follows:
/index.php?page=CategoryLevel1&rlVareables=rest-of-path-including-SubcategoryLevel1&listing_id=815

It will actually redirect to the correct page if you enter:
/index.php?page=any-active-category&rlVareables=&listing_id=815

But it won't work if page= is blank, and it's too messy to point it to a wrong category so I wouldn't want to do that.

This might be too complicated for me to work out to start, so I think I'll add this to my list of customization requests that I'll get you to help me with :)
I have one customization request pending regarding the xls import plugin customization, so after that one I'll put in a request regarding this one :)
Many thanks!

Rudi
January 21, 2024, 09:50 AM
As an alternative, you can use Reference Number plugin that supports short listing url with only reference number like .../RF546193/

For that:

- you need to install the plugin

- go to your listing type settings > Listing type URL; Ref number in listing URLs > Yes

Horizon
January 21, 2024, 08:10 PM
I thought about using the reference number plugin for this, setting reference number = listing ID number.

However in my first test, I ran into an issue, where if I enable ref number in listing urls, listing titles get messed up where I'm building listing title = category + subcategory + length.

https://forum.flynax.com/showthread.php?8107-Can-t-set-title-to-category-name-with-Ref-number-in-listing-URLs

I think I will ask you to do a customization for me so I can use both normal URLs (/category/subcategory/listingtitle.html) AND use some of the code from "ref number in listing URL" as an "add-on" so I could use both (allowing "url with ref numbers in URL" logic to redirect to normal URLs for me when I only have the listing ID# as the incoming URL for pre-existing URLs that I want to maintain and direct to the correct page in the new Flynax site.)