You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't a feature request per se, as it's the expected functionality.
Go to https://forum.phalconphp.com/category/21/beginners for example (as it has the most threads).
Then click "Start a Discussion" on that page, there's a "Category" dropdown to choose the category again. Expected behavior is it should pre-select "Beginners" in this case. I'd like to suggest use the referrer to determine what to highlight. This JavaScript has been tested thoroughly and would get the job done:
try{
(function(){
var r = document.referrer, m = r.match(/\/category\/(\d+)\/([^\/]+)/), e = document.getElementById("categoryId"), o = e.options;
for(var i=0;i<o.length;i++)if(o[i].value==m[1] && o[i].text.match(/(\w+)/)[1].toLowerCase() == m[2].match(/(\w+)/)[1].toLowerCase())e.selectedIndex=i;
})();
}catch(E){}
The text was updated successfully, but these errors were encountered:
If we're aiming at a PHP solution, we could read $_SERVER['HTTP_REFERER'] and parse it using a similar regular expression, then add a selected to the option to select. We could also change the navigation a bit and ditch the refe(r)rer altogether by creating a different create new topic link which we can extract the category from.
This isn't a feature request per se, as it's the expected functionality.
Go to https://forum.phalconphp.com/category/21/beginners for example (as it has the most threads).
Then click "Start a Discussion" on that page, there's a "Category" dropdown to choose the category again. Expected behavior is it should pre-select "Beginners" in this case. I'd like to suggest use the referrer to determine what to highlight. This JavaScript has been tested thoroughly and would get the job done:
The text was updated successfully, but these errors were encountered: