Hi,
I am implementing Q2A as part of my web app (using YII framework). I got most of the stuff working but the relative URLs are causing some issues. I would like to enforce absolute urls everywhere in Q2A including the form actions.
is there an esier way to achieve that? I saw question #11847 and Gideon's suggestion to use qa_q_path for specific pages but it doesn't solve my issues. I would prefer if there is a sigle place where I can define / overide and have all the urls as absolute urls.
is it possible or am I looking to refactor a lot of code?
Thanks for your help.
Nikhil
Edit: Here are more details
Lets say we have two urls
a. example.com/q2a/admin, and
b. example.com/q2a/questions
My app has its own URL management and if there are relative paths in Q2A then I am seeing two issues
1. Once in the admin page (url 1), every thing else points to admin/<URI> so url b above will become example.com/q2a/admin/questions which ofcourse is not right
2. Once on the home page, all the pages jump one directory above so from q2a home page the new url for b becomes example.com/questions skipping the q2a directory part
For my test, I got most of the absolute paths working by changing qa_q_path and qa_q_path_html default for $absolute=true and also within the app converting any call to these two functions with $absolute=false to true. this approach is messy and perhaps I should override the above two methods to always use $absolute=true so as to minimize the changes to q2a code...
All the url's work fine now but I can NOT submit any form. e.g. for ask form, the page url is example.com/q2a/ask and the form post method shows action example.com/q2a/?qa=ask which is still ok as I can access the page with this url but nothing happens when I submit the form. Same story for all the forms. They are not working. No error message nothing. Not sure is this is due to URLs or I messed up something else. will keep probing... if someone has any pointers, a better approach will appreciate it.