Nacman Posted December 11, 2023 Report Posted December 11, 2023 Hi there, I have a news item that shows up once you log in. I would like to have this same News item show up on the first page before login. I have home.blade and app.blade loaded up and I am trying to follow the help part about "DBasic.news /dnews" but I think that is for a menu item. Also looking at the widget section oof the FAQ, but doesn't mention news. This is probably so easy, but it still isn't making perfect sense to me yet. So what would I edit and what would I put in the edit to get news to show up to users who haven't logged in yet or first time visitors. Thanks, -Nac Quote
DisposableHero Posted December 11, 2023 Report Posted December 11, 2023 (edited) This is not related to an addon route or page (because DBasic.news is a page to display all news, not a widget to place somewhere) What you need to do is, placing latest news widget (which is a part of phpvms v7 itself) to your home.blade.php. You can check the default theme's dashboard/index.blade.php or disposable theme's dashboard/index.blade.php to see how widgets are placed in blades. Also Dispo Basic's readme file explains the general logic about placing widgets and configuring them. Even though it gives examples for its own widgets, similar calls can be used for default widgets (like latest news, latest pireps, latest pilots, livemap etc) Good luck Edited December 11, 2023 by DisposableHero 1 Quote
DisposableHero Posted December 11, 2023 Report Posted December 11, 2023 https://github.com/nabeelio/phpvms/blob/15563e1181dd4b6ae38e161fadb733c6a8392333/resources/views/layouts/default/dashboard/index.blade.php#L83 https://github.com/FatihKoz/DisposableTheme/blob/50ad455eb8ae4f3565723d0dbc1e70f13fee4016/resources/views/layouts/Disposable_v3/dashboard/index.blade.php#L40C44-L40C44 {{ Widget::latestNews(['count' => 3]) }} @widget('latestNews', ['count' => 3]) Both will end up loading the Latest News widget with last 3 news you entered. 1 Quote
Nacman Posted December 11, 2023 Author Report Posted December 11, 2023 Thank you. I actually was thinking that, based on some of what I saw throughout the code that it could be similar to one or the other, but because of that I was also confused. I could have tried, but thought it easier to ask, since it is my first outing. On a side note, I am keeping notes of files (and copy of files) that I have changed to to suit a need. So far succesful, nothing broke yet 🙂. I assume keeping these notes and files is almost mandatory as when a theme or phpvms gets updated they will be over written, correct? Thanks for the code above!!!!!! -RIchard aka Nacman Quote
Administrators ProAvia Posted December 12, 2023 Administrators Report Posted December 12, 2023 When you update phpVMS on your site, any core changes will be over written. Keep a copy of your edited files somewhere safe where they won't get over written. In the Dispo Theme readme, it suggests making a copy of the Dispo Theme and using that copy for your edits. That way, when you update Dispo Theme, it's easy to compare the new files to your edited ones. In essence, this copy becomes your personalized theme. And you don't need to be concerned about over writing edited files. I only copy Dispo files to my theme that I intend to change. If a file in your theme isn't there, it will use the file from the Dispo Theme. Likewise, if the file isn't in Dispo Theme, it will use the file from the default theme. 1 Quote
DisposableHero Posted December 12, 2023 Report Posted December 12, 2023 21 hours ago, Nacman said: On a side note, I am keeping notes of files (and copy of files) that I have changed to to suit a need. So far succesful, nothing broke yet 🙂. I assume keeping these notes and files is almost mandatory as when a theme or phpvms gets updated they will be over written, correct? Follow duplication procedure... That simple it is, as explained in @ProAvia's post and is explained with examples in my readme files (subliminal message for reading the readme files) :) Duplication logic works for default theme too, so whatever theme (or my module blade files) you are playing on , duplication saves your life ;) Good luck and enjoy. 1 Quote
Nacman Posted December 12, 2023 Author Report Posted December 12, 2023 3 hours ago, DisposableHero said: Follow duplication procedure... That simple it is, as explained in @ProAvia's post and is explained with examples in my readme files (subliminal message for reading the readme files) :) Duplication logic works for default theme too, so whatever theme (or my module blade files) you are playing on , duplication saves your life ;) Good luck and enjoy. I really have been reading, just not recalling all of it yet. Trying very fast to get the site working so the guys you have joined back up can start flying or I will lose their interest. Trust me, everytime I post with a problem I can't figure out I feel as if it is somewhere to read about it. -Nac Quote
Administrators ProAvia Posted December 13, 2023 Administrators Report Posted December 13, 2023 2 hours ago, Nacman said: Trust me, everytime I post with a problem I can't figure out I feel as if it is somewhere to read about it. This is true in 99% of cases. 😇😵 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.