a
Chapter 5 walks you through more advanced features of channels, including a multiple-entry page, a single-entry page, comments, categories, news feeds and captchas.
There are no updates or errata at this time.
{preload_replace:my_channel="faqs"} {preload_replace:my_template_group="faqs"} {preload_replace:my_single_entry_template="browse"} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- Design adapted from Pluralism by Free CSS Templates http://www.freecsstemplates.org Released for free under a Creative Commons Attribution 2.5 License --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> {if segment_2=="category"} {exp:channel:category_heading channel="{my_channel}"} <title>Questions About {category_name} - Ed & Eg Financial Advisors</title> {/exp:channel:category_heading} {if:else} <title>Frequently Asked Questions - Ed & Eg Financial Advisors</title> {/if} <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="{stylesheet=includes/site_css}" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="wrapper2"> <div id="header"> {website_sitename} {website_menu} </div> <!-- end #header --> <div id="page"> <div id="content"> {if segment_2=="category"} {exp:channel:category_heading channel="{my_channel}"} <h1>Questions About {category_name}</h1> <p>{category_description}</p> {/exp:channel:category_heading} {if:else} <h1>Frequently Asked Questions</h1> <p><strong>Ed & Eg</strong> have been assisting people for over 30 years. If you have a financial question that's burning a hole in your pocket, email us at faq@example.com and we will answer it here!</p> <p>Don't forget to subscribe to our <a href="{site_url}faqs/rss" title="RSS Feed">RSS feed</a> to stay up-to-date with new FAQs as they are posted.</p> {/if} {exp:channel:entries channel="{my_channel}" limit="10" paginate="bottom"} <h2>{title}</h2> <p><strong>Q: </strong><em>{faqs_question}</em></p> <p><strong>A: </strong><a href="{title_permalink="{my_template_group}/{my_single_entry_template}"}">Read the answer here!</a></p> <p class="meta"><strong>Categories: </strong>{categories backspace="3"}<a href="{path={my_template_group}}">{category_name}</a> | {/categories}<a href="{comment_url_title_auto_path}" class="comments">Comments ({comment_total})</a></p> {paginate} {if "{total_pages}" != 1} <hr /> <p>Page {current_page} of {total_pages} pages {pagination_links}</p> {/if} {/paginate} {/exp:channel:entries} </div> <!-- end #content --> {website_sidebar} <div style="clear: both;"> </div> {website_faqs} </div> <!-- end #page --> </div> <!-- end #wrapper2 --> <div id="footer"> <p>(c) 2007 Eg & Ed. Design by <a href="http://www.nodethirtythree.com/">NodeThirtyThree</a> + <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p> </div> </div> <!-- end #wrapper --> </body> </html>
{preload_replace:my_channel="faqs"} {preload_replace:my_template_group="faqs"} {preload_replace:my_single_entry_template="browse"} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- Design adapted from Pluralism by Free CSS Templates http://www.freecsstemplates.org Released for free under a Creative Commons Attribution 2.5 License --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>{exp:channel:entries channel="{my_channel}" disable="categories|category_fields|custom_fields|member_data|pagination"}{title}{/exp:channel:entries} - Ed & Eg Financial Advisors</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="{stylesheet=includes/site_css}" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="wrapper2"> <div id="header"> {website_sitename} {website_menu} </div> <!-- end #header --> <div id="page"> <div id="content"> {exp:channel:entries channel="{my_channel}" limit="1" require_entry="yes"} {if no_results} {redirect="404"} {/if} {if segment_4 != ''} {redirect="404"} {/if} <h1>{title}</h1> <p><strong>Q: </strong><em>{faqs_question}</em></p> <p><strong>A: </strong>{faqs_answer}</p> <p><a href={path={my_template_group}} title="Back to FAQs page">Back to FAQs</a></p> {/exp:channel:entries} <h3>Comments</h3> {exp:comment:entries} {if comments} <p>{comment}</p> <p class="meta">Posted by {name} on {comment_date format='%m/%d'} at {comment_date format='%h:%i %A'}</p><br /> {/if} {if no_results} <p>There are no comments at this time - be the first to share your thoughts!</p> {/if} {/exp:comment:entries} {exp:comment:preview} <p>{comment}</p> <p class="meta">Being previewed by {name} on {comment_date format='%m/%d'} at {comment_date format='%h:%i %A'}</p><br /> {/exp:comment:preview} {exp:comment:form preview="{my_template_group}/{my_single_entry_template}"} <h3>Post Your Own Comment</h3><br /> {if logged_out} <p><label for="name">Name:</label> <input type="text" name="name" id="name" value="{name}" size="50" /></p> <p><label for="email">Email:</label> <input type="text" name="email" id="email" value="{email}" size="50" /></p> {/if} <p> <label for="comment">Comment:</label><br /> <textarea name="comment" id="comment" cols="80" rows="12">{comment}</textarea> </p> <p> {if logged_out} <input type="checkbox" name="save_info" id="save_info" value="yes" {save_info} /><label for="save_info">Remember my personal information</label><br /> {/if} <input type="checkbox" name="notify_me" id="notify_me" value="yes" {notify_me} /><label for="notify_me">Notify me of follow-up comments?</label> </p> {if captcha} {captcha} <p><label for="captcha">Submit the text you see in the image above:</label> <input type="text" name="captcha" id="captcha" value="" size="20" maxlength="20" style="width:140px;" /></p> {/if} <p> <input type="submit" name="submit" value="Submit" /> <input type="submit" name="preview" value="Preview" /> </p> {/exp:comment:form} <h2>Other Questions Like This</h2> <br /> {exp:channel:entries channel="{my_channel}" limit="5" related_categories_mode="yes" custom_fields="yes" orderby="random"} {if no_results} <p>There are no questions like this currently – check back soon though...we’re always adding more!</p> {/if} <p><strong>Q: </strong><em>{faqs_question}</em><br /> <strong>A: </strong><a href="{title_permalink="{my_template_group}/{my_single_entry_template}"}">Read the answer here!</a></p> {/exp:channel:entries} </div> <!-- end #content --> {website_sidebar} <div style="clear: both;"> </div> {website_faqs} </div> <!-- end #page --> </div> <!-- end #wrapper2 --> <div id="footer"> <p>(c) 2007 Eg & Ed. Design by <a href="http://www.nodethirtythree.com/">NodeThirtyThree</a> + <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p> </div> </div> <!-- end #wrapper --> </body> </html>
{exp:rss:feed channel="faqs"} <?xml version="1.0" encoding="{encoding}"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> <title>{exp:xml_encode}{channel_name}{/exp:xml_encode}</title> <link>{channel_url}</link> <description>{channel_description}</description> <dc:language>{channel_language}</dc:language> <dc:creator>{email}</dc:creator> <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights> <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date> <admin:generatorAgent rdf:resource="http://expressionengine.com/" /> {exp:channel:entries channel="faqs" limit="10" dynamic_start="on" disable="member_data"} <item> <title>{exp:xml_encode}{title}{/exp:xml_encode}</title> <link>{comment_url_title_auto_path}</link> <guid>{comment_url_title_auto_path}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid> <description><![CDATA[<p>{faqs_question}</p><p><a href="{title_permalink=faqs/browse}">Find out...</a></p>]]></description> <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject> <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date> </item> {/exp:channel:entries} </channel> </rss> {/exp:rss:feed}
{exp:rss:feed channel="faqs"} <?xml version="1.0" encoding="{encoding}"?> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{channel_language}"> <title type="text">{exp:xml_encode}{channel_name}{/exp:xml_encode}</title> <subtitle type="text">{exp:xml_encode}{channel_name}:{channel_description}{/exp:xml_encode}</subtitle> <link rel="alternate" type="text/html" href="{channel_url}" /> <link rel="self" type="application/atom+xml" href="{path={atom_feed_location}}" /> <updated>{gmt_edit_date format='%Y-%m-%dT%H:%i:%sZ'}</updated> <rights>Copyright (c) {gmt_date format="%Y"}, {author}</rights> <generator uri="http://expressionengine.com/" version="{version}">ExpressionEngine</generator> <id>tag:{trimmed_url},{gmt_date format="%Y:%m:%d"}</id> {exp:channel:entries channel="faqs" limit="15" dynamic_start="on" disable="member_data"} <entry> <title>{exp:xml_encode}{title}{/exp:xml_encode}</title> <link rel="alternate" type="text/html" href="{comment_url_title_auto_path}" /> <id>tag:{trimmed_url},{gmt_entry_date format="%Y"}:{relative_url}/{channel_id}.{entry_id}</id> <published>{gmt_entry_date format="%Y-%m-%dT%H:%i:%sZ"}</published> <updated>{gmt_edit_date format='%Y-%m-%dT%H:%i:%sZ'}</updated> <author> <name>{author}</name> <email>{email}</email> {if url}<uri>{url}</uri>{/if} </author> {categories} <category term="{exp:xml_encode}{category_name}{/exp:xml_encode}" scheme="{path=faqs/browse}" label="{exp:xml_encode}{category_name}{/exp:xml_encode}" />{/categories} <content type="html"><![CDATA[ <p>{faqs_question}</p><p><a href="{title_permalink=faqs/browse}">Find out...</a></p> ]]></content> </entry> {/exp:channel:entries} </feed> {/exp:rss:feed}
<div id="widebar"> {exp:channel:entries channel="faqs" limit="3" orderby="random" dynamic="off"} <div id="{switch='colA|colB|colC'}"> <h3>Frequently Asked Question</h3> <p>{faqs_question} <a href="{title_permalink=faqs/browse}">Find out…</a></p> </div> {/exp:channel:entries} <div style="clear: both;"> </div> </div> <!-- end #widebar -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- Design adapted from Pluralism by Free CSS Templates http://www.freecsstemplates.org Released for free under a Creative Commons Attribution 2.5 License --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Page Not Found - Ed & Eg Financial Advisors</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="{stylesheet=includes/site_css}" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="wrapper2"> <div id="header"> {website_sitename} {website_menu} </div> <!-- end #header --> <div id="page"> <div id="content"> <h1>Page not Found (404)</h1> <p>The page you were looking for does not exist. There may be a spelling mistake in the URL in the address bar, or we may have removed this page inadvertently. Please use the menu at the top to visit a page that does exist.</p> </div> <!-- end #content --> {website_sidebar} <div style="clear: both;"> </div> {website_faqs} </div> <!-- end #page --> </div> <!-- end #wrapper2 --> <div id="footer"> <p>(c) 2007 Eg & Ed. Design by <a href="http://www.nodethirtythree.com/">NodeThirtyThree</a> + <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p> </div> </div> <!-- end #wrapper --> </body> </html>
{preload_replace:my_channel="website"} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- Design adapted from Pluralism by Free CSS Templates http://www.freecsstemplates.org Released for free under a Creative Commons Attribution 2.5 License --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>{exp:channel:entries channel="{my_channel}" limit="1" url_title="{embed:url_title}" disable="categories|category_fields|custom_fields|member_data|pagination"}{title}{/exp:channel:entries} - Ed & Eg Financial Advisors</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="{stylesheet=includes/site_css}" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="wrapper2"> <div id="header"> {website_sitename} {website_menu} </div> <!-- end #header --> <div id="page"> <div id="content"> {exp:channel:entries channel="{my_channel}" limit="1" url_title="{embed:url_title}"} <h1>{title}</h1> {if website_image}<img src="{website_image}" class="left" />{/if} {website_content} {/exp:channel:entries} </div> <!-- end #content --> {website_sidebar} <div style="clear: both;"> </div> {website_faqs} </div> <!-- end #page --> </div> <!-- end #wrapper2 --> <div id="footer"> <p>(c) 2007 Eg & Ed. Design by <a href="http://www.nodethirtythree.com/">NodeThirtyThree</a> + <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p> </div> </div> <!-- end #wrapper --> </body> </html>