Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After thinking about this for a while, I found that the best solution (for me) to this is to have a string just hold all the arguments that I need in a clean URL.</p> <p>So, when users first come to <strong><a href="http://foo.com/" rel="nofollow noreferrer">http://foo.com/</a></strong> they are presented with a locations to select. Cookies are empty at this point. </p> <p>So, a user goes ahead and selects United-State, the URL will look like <a href="http://foo.com/12334_0_0_0/United-States/" rel="nofollow noreferrer">http://foo.com/12334_0_0_0/United-States/</a> and the location cookie is set to 1234 which is the id for location United States.</p> <p>Now the user selects California and the URL changes to <a href="http://foo.com/1235_0_0_0/United-States-California/" rel="nofollow noreferrer">http://foo.com/1235_0_0_0/United-States-California/</a> and cookie is replace from United states to 1235 which is the id for the location California. At this point the user selects Category Electronics. so the URL changes to <a href="http://foo.com/1235_3333_0_0/Electronics/" rel="nofollow noreferrer">http://foo.com/1235_3333_0_0/Electronics/</a> and 3333 is saved in the Category Cookies. </p> <p>If the users drops down to SLR Camera, then s/he'll see <a href="http://foo.com/1235_3344_0_0/SLR-Cameras/" rel="nofollow noreferrer">http://foo.com/1235_3344_0_0/SLR-Cameras/</a>.</p> <p>This way, the first portion of the URL keeps track of up to 4 arguments which can be passed around and the names (slugs) are merely for presentation and SEO.</p> <p>I think this would work right? It would be cool to have the x_y_z_p portion of the URL encoded into some random text and decode back into args &amp; numbers.</p> <p>Let me know what you do think?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload