[wp-trac] [WordPress Trac] #25963: Appearance Themes: Backbone.Router should use pushState with ?query type urls

WordPress Trac noreply at wordpress.org
Tue Dec 10 04:55:31 UTC 2013


#25963: Appearance Themes: Backbone.Router should use pushState with ?query type
urls
------------------------------+---------------------
 Reporter:  matveb            |       Owner:
     Type:  enhancement       |      Status:  closed
 Priority:  high              |   Milestone:  3.8
Component:  Appearance        |     Version:  trunk
 Severity:  major             |  Resolution:  fixed
 Keywords:  has-patch commit  |
------------------------------+---------------------

Comment (by adamsilverstein):

 Replying to [comment:28 matveb]:
 > I have been working on a possible solution that will allow us to use
 routing instead of passing the url params via localize script. We can
 parse the url parameters from {{{Backbone.history}}} and then trigger
 proper {{{route:theme}}} events which we hook to the same way we were
 doing before.
 >
 > I have it working but things got out of sync with the latest commit
 here. This is what I propose, though, what do you think?
 >
 > https://cloudup.com/cPHH02p4W9s
 >
 > (The RegEx can probably be tweaked to be more robust.)

 Excellent - I really prefer this all JavaScript approach to the routing -
 it seems to work well and is pretty straightforward (other than the
 extracting the args from Backbone.history.location.search). It deserves
 more testing, hopefully this patch helps with that.

 [attachment: 25963.12.diff] introduces your approach against trunk and
 removes the  wp_localize_script pass of theme and search vars.

 we should add a ?s=themename url for backward compatibility with existing
 links (or how about just keeping ?s=themename as the search string?)

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25963#comment:29>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list