Saving Web Page Settings Configuration
so i building web apps based on almsaeedstudio adminlte template (it is awesome by the way), and i like the way the sidebar collapse into mini sidebar but when i refreshed the page to navigate to other page the sidebar won't stay collapse and i still want a full size sidebar
so i thinking there must be a way to make my site remember what state it is, so it maybe like saving something to browser or database and then i just check it in my html tags with css class.
well the first thing that come to my mind is saving to database to my user table, but doing so mean i need to do some post/get process that won't work seamlessly or maybe there is a way to do that? since it just a simple toggle to change full sidebar and mini sidebar so maybe a light operation that won't affect performance....
by the way i am using laravel (maybe there is laravel-ish way? lol)
Answer
if you want to keep this setting, you will have to save it on the database side.
and since it just a small flag it wont take that much to be updated on the database. you can always save the value in the session/cookie and just get the data when he login to the system
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM