Modifying the template to add dynamic behavior
We have now created the template that renders the content of the resource at a specific location. Let us now extend it, by using our newly-acquired knowledge of template variables, to also show the resource title. The resource-specific variable for this is pagetitle
. Modify the template by adding the highlighted segment, which we have created to contain the title, giving the following HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Learning Modx</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" type="text/css" href=" assets/templates/learningMODx/style.css " /> </head> <body> <div id="banner"> <h1>Learning MODx</h1> </div> <div id="wrapper"> <div id="container"> <div id...