-
-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow programmatic barba.history
management
#601
Comments
Hello @MichaelPrecel, Sorry for the laaaaaaate reply 😄 Anyway, about what you are trying to achieve, why not using sub pages as final URLs? I mean, if you have
In this case, you will be able to use custom transitions when navigating to your sub pages.
|
I think it's not really a matter of final URLs. Even if we would have final URLs the problem would be the same. @MichaelPrecel correct me if I'm wrong, but you is at stake is to have:
Basically, the idea is to bypass barba transition and use Ajax while no breaking the history of barba. |
Hi @psntr, Well, depends on what @MichaelPrecel is meaning of course 😃 As of today, you can't change URL without affecting history, as Barba uses barba.history.add('http://dev.local/projects/sub-page', 'barba'); Please @MichaelPrecel, feel free to add your comments below 😉
|
Hi @xavierfoucrier, Thanks for your further clarifying @psntr — that is exactly right: "Basically, the idea is to bypass barba transition and use Ajax while no breaking the history of barba" using ajax loading of sub-page content in modals. Good to know @xavierfoucrier re barba.history.add. If I can recall, while trying this I found it was interfering with the regular back/forward buttons. I ended up finding a sort-of solution by replacing the current history state with the new subpage URL and then managing first land at that address with PHP & Javascript. A bit fiddly and regular back button function was the sacrificial lamb. Cheers, |
I just added a short dedicated section about history management.
|
barba.history
barba.history
management
Thank you Xavier, here is the link in case people wonder where the section is: |
Hi everyone 👋 Just dive into it last week, you can build case defined by @psntr using:
In that case, the attribute tells Barba to replace/update current state in the history stack. I am only seeing one problem here: the use of |
I'm trying to create a site with interactive 'subpages' that slide out over an existing page (with content loaded into them via AJAX), and have this hook into the Barba History so that:
I've been trying to make heads or tails of the Barba.history documentation to no success. Trying to achieve the above using barba.history.add() / barba.history.remove() has led to some very strange popstate events after doing so. Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: