
rts5678
User
Sep 8, 2004, 10:14 AM
Post #3 of 3
(4194 views)
Shortcut
|
|
Re: [leeshields] Favorites.cgi Advanced Problem
[In reply to]
|
Can't Post
|
|
Lee, a fast response from you is very much appreciated. I had thought about both approaches you mentioned, but didn't go for either as I certainly wanted to use my custom template and not the actual listing template that comes with the program, and I didn't want to add an extra step by creating another search in fav_view.html file. I wanted a simple straight forward (URL based) solution to the problem. (URL based solution meaning, creating a favorites output URL with either pasting a full URL or part of a URL in the fav_view file, and/or passing a full URL or part of a URL from the custom publish listings template to the fav_view file). So here's how I cracked the problem (after quite a few painful hours), The approach includes using part of the URL from fav_view.html file and part of the URL from the your publish listing template (or whichever template page on your website you have provided the link to 'add to favorites'). My URL portion of fav_view.html file looks like this: <a href="$url$?view=$listdata1$&template=some_custom_template_you_are_using.html">$name$</a> My URL porition of my custom template 'Add to Favorites' link looks like this : url=$search_url$&listdata1=$listing_num$ The $url$ part in the beginning of the fav_view.html is filled/replaced by the *url=........* part from your "Add to Favorites" link embedded in your custom template. Here's the key step: What you do is make this assignment: 1-listdata1=$listing_num$ (in your custom publish listing template) 2-And, in the URL part of your fav_view.html, you make this assingment, view=$listdata1$ So what we have is the listing number(the most important part of the problem) being passed from your custom template as listdata1 to the fav_view.html file being outputted dynamically in the form of view=$listdata1$ in your final URL, giving you the final result. The above approach becomes a must when you are using listings manager for multiple categories eg. auto, realty, generic, etc and creating multiple custom templates (query, search results, publish listing) for each category in which case you need to make the output of favorites.html completey dynamic and independent of any category. Finally, if you are not using a custom search template, you may be able to adopt the above approach by using one url in either fav_view.html file, or from the *url=........* part from your "Add to Favorites" link embedded in your custom template, rather than borrowing part from each. Also, unrelated to the above problem, in favorites.cgi, it'd be appreciated if someone can address the filelock renaming issue, (changing it from filelock.lock to something else.lock) as favorites.cgi does NOT work without changing the name. (time cost = 2 hours, solution found in the forums). Many thanks to all who post in the forum regularly including interactive tools' great staff. Alex,
|