Server-Side Includes From List

The Server-Side Includes From List server behavior allows the site developer to include files in the current Dreamweaver page, files that are individually specified in a list. Besides the filename, some additional information is necessary (and manually specified):

Note: Read more about meta keywords and meta description and see an example here.

 

This server behavior is accessible from the Application panel, Server Behaviors -> + -> MX Kollection -> Server-Side Includes -> Server-Side Includes From List. The user interface has two tabs:

 

To set the dialog box options for the first tab, follow the next steps:

  1. In the Include files grid, you can list the URL parameter values and the files they point to. You can add or remove elements by clicking on the Plus (+) and Minus (-) buttons on top of the grid. Also, you can change the order in which elements are displayed by pressing the Up (^) and Down (v) buttons.
    For each element of this list, you have to provide the information mentioned below.
  2. In the URL value text box enter the value for the URL parameter passed.
    Note:
    If you choose to enter no value in the URL value text box, then the associated file will be the one loaded by default in browser.
    Note:
    If you enter the value 404 for the URL parameter value, then the associated file will be automatically loaded when a page cannot be found (e.g. due to a missing page, or a wrong URL parameter value).
  3. In the Filename text box enter the file to be included in the current Dreamweaver page. You can click the Browse button to select the file. Choose a file from the site structure so there won't be any problems when you publish the site. If you want to include a file outside the site structure, you should copy it somewhere in the root folder and then upload it onto the server.
  4. In the Page title text box enter the title that you want to be displayed in the browser bar.
  5. In the Meta keywords text box enter the meta keywords of the included file.
  6. In the Meta description text box enter the meta description of the included file.
  7. The three buttons in the top right corner of the interface offer you the next functionalities:
    · Click OK when you are done configuring the server behavior.
    · Click Cancel to exit without applying the new settings.
    · The Help button opens this help page.
    These buttons are common to both tabs of the Server-Side Includes From List server behavior interface.
  8. Click on the Parameter tab to continue configuring the server behavior.
 

 

To set the dialog box options for the second tab, follow the next steps:

  1. In the URL parameter name text box enter the name of the URL parameter that you are going to use in your site pages. The default name given is mod.

  2. Click OK when you are done configuring the server behavior.

Before being able to see this server behavior at work, there are several things that need to be done in your current Dreamweaver page (let's consider this page being named includes.php):

Note: If you applied the Server-Side Includes From List server behavior in your page, you cannot apply it again in the same page, and you cannot apply Server-Side Includes From Table either.

Using friendly URL's.

"Friendly" URL's can increase your site's ranking on various search engines. With the new MX Includes, you can customize the URL's displayed in the address bar of your site, transforming them into "friendly" URL's. For example, with the configuration above, when the product.php file is loaded, the URL is:

http://your_server/your_folder_hierarchy/your_site/includes.php?mod=product.

However, this URL will receive a poor ranking on search engines such as Google, because the address contains parameters. Instead, you could turn the above URL into something easier to read:

http://your_server/your_folder_hierarchy/your_site/includes.php/product

With the new MX Includes (only on Apache), URL's for the included files can be rewritten to become Google friendly.

Note: In order to use friendly URL's, PHP must be compiled as an Apache module. When PHP runs as CGI, friendly URL's cannot be used.

If you want to turn it into a 'nicer' URL, follow the next steps:

  1. In the Basic tab, add a slash (/) before the URL value (product) in the corresponding interface field:


     

  2. In the Advanced tab, delete the name of the URL parameter, leaving the text box blank:


     

  3. Select the link that when clicked, uploads the included file, and in the Property Inspector, replace the "?mod=" with a slash (/):


     

  4. If you preview the page in browser and click on the link, you will notice the nice URL being displayed in the address bar:
    http://your_server/your_folder_hierarchy/your_site/includes.php/product