How to Build a Basic, Dynamic News Website
Dynamic Web design is a popular choice for many news sites because it tailors featured stories to topics that the user is interested in reading about. Personalizing content to the reader increases user engagement levels and the time they spend on your site. Dynamic sites initially take longer to build than static websites, but their segmented nature and use of databases to store information makes updating your content a smoother process.
Defining Your Elements
A dynamic website uses a server technology, like PHP, to create a custom page as soon as your customer visits. Define the parts of your website -- such as your logo and navigation buttons -- that you want to keep the same for every visitor. Code the static areas of your website with as a header and footer so they are always present, even when a page updates to match a user’s preference. Separate the changeable content areas by adding display parameters; in PHP this can be done by adding the GET parameter to an “$action =” line.
Client and Server-Side Scripting
Dynamic websites use a combination of client-side and server-side scripting to choose what content to display. Client-side scripting creates a Web page based on the user’s actions, such as typing in a search form or clicking a button. News sites use client-side scripting to determine what type of content to display, such as loading a sports news frame when a user clicks on a “Sports” tab. Server-side scripting builds a page based on a server action, such as a call for content with a specific tag. Server-side scripting is used to populate the sports section by making a server call for the most recent content you have labeled as sports stories.
Content Management and Tagging
News websites need a complex content management system to support dynamic displays. Stories will need to be timestamped and tagged with their section designation, such as Sports, as well as any special location designations, such as featured story or a homepage story. Create your calls to search for these tags instead of specific story titles or page locations. You will call the most recent stories to each section if they are timestamped, because your content management system automatically orders them by the most recent.
Create a baseline version of your site’s homepage that automatically populates each field with the most recent or most popular content. Users who haven’t provided a preference or input will see the baseline version of your site. Insert any promotions, advertisements or stories you want featured as static page elements, so they always load on your homepage. Add GET and action commands to the homepage so it adjusts as soon as the user takes a specified action, such as clicking a content tab or entering a search.