Allen Lawson Posted February 6, 2012 Share Posted February 6, 2012 Hey there,I was wondering how at times Wikipedia displays that banner at the top of every page when they want one to be there. I use php inlcudes for my website but I know thats probably not what there using because sometimes there is no banner. I guess another great example would be how YouTube sometimes haves alerts for new things going on at the top. Any thoughts / how to do this would be great! Thanks, Allen Lawson Link to comment Share on other sites More sharing options...
Ingolme Posted February 6, 2012 Share Posted February 6, 2012 They have a content management system. While it might have includes somewhere in the code, it uses a program to determine what to write and where. Link to comment Share on other sites More sharing options...
Allen Lawson Posted February 6, 2012 Author Share Posted February 6, 2012 But you have no idea how to code for this kind of thing - or even what language you use to craft something like this? Link to comment Share on other sites More sharing options...
thescientist Posted February 6, 2012 Share Posted February 6, 2012 The concept is very simple, but implementation vary widely. A CMS could handle how to output banners, or perhaps a PHP include. You could always try Googling how Wikipedia engineers their site if you are really interested. Link to comment Share on other sites More sharing options...
Ingolme Posted February 6, 2012 Share Posted February 6, 2012 Content managing systems can be very complex. With your level of experience, just use include on the pages you want it to appear. If you have one index page that manages sections, you can use switch() if you want to filter pages. /* Example 1: Put the banner only on these pages */switch($page) { case 'home': case 'contact': case 'about': include 'banner.php';} /* Example 2: Put the banner on all pages except these ones */switch($page) { case 'home': case 'contact': case 'about': break; default: include 'banner.php';} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.