Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Permalink Hashbang implementation - /#!/
#1
I'm developping a getSimple/jQuery plugin to add some HTML5 effects and interactions within getSimple.
To test the plugin "LIVE" I require hash urls.

The links would look like this:
http://www.example.com/#!/homepage
http://www.example.com/#!/news
http://www.example.com/#!/contact

Currently I have all link populated correctly on the fronEnd but according content doesn't load.

Changed .htaccess rule to be :
RewriteRule /#!/?([A-Za-z0-9_-]+)?$ index.php?id=$1 [QSA,L]

Changed Permalink Configuration settings:
#!/%parent%/%slug%/


I think the url to be loaded should be stored somewhere in a session and then used by the page that load the content but... I've no clue where to start and which file need to be modified.

Any help or alternative solution on this development would be greatly appreciated
Reply
#2
my guess is that it's the rewrite rule that's getting you.

what about this:
Code:
RewriteRule /#!/([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

If you find out a problem (if there is one) I will gladly fix it in the core if it doesnt break anything else.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
I've tried your .htaccess RewriteRule but unfortunately the problem persist.

On the front-end source links are like
<a href="http://www.example.com/#!/contentpage/" title="Content page">Page</a>

Seems that the part after the # is skipped server side and getSimple isn't able to find the relative page to be loaded.

Where could we instruct getSimple to get the hash part (parse_URL ?) and load the appropriate content?
Reply
#4
index.php is where it reads in the 'id' and then loads the page. Thats where you need to start
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#5
roma Wrote:On the front-end source links are like
<a href="http://www.example.com/#!/contentpage/" title="Content page">Page</a>

Seems that the part after the # is skipped server side and getSimple isn't able to find the relative page to be loaded.

Browsers in general do not send anything after a # to the server, but use this part afterwards to find the corresponding anchor in the returned page. So the server will only get http://www.example.com/!
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#6
ahh, thats right. So what you will probably have to do is read that hash value with jQuery, then on the backend request the correct page and load it into the current template ... all via ajax
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply




Users browsing this thread: 1 Guest(s)