Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What you’re seeing is URL rewriting. This can be done within the web server, not necisarlay with in ColdFusion/PHP ext. What the web server will do is rewrite the url <code>mayoclinic.com/health/infant-jaundice/DS00107/DSECTION=symptoms</code> to a link something like: <code>mayoclinic.com/health/infant-jaundice/DS00107/index.cfm?DSECTION=symptoms</code>.</p> <p>For displaying the content with in the page, I would use as switch statment vs. using a series of if/else’s if you have more then 2-3 possible displays. You can use as many case blocks as needed.</p> <pre><code>&lt;cfswitch expression=”#url.DSECTION#&gt; &lt;cfcase value="symptoms"&gt; &lt;!--- symptoms code / html here ---&gt; &lt;/cfcase&gt; &lt;cfcase value="causes"&gt; &lt;!--- causes code / html here ---&gt; &lt;/cfcase&gt; &lt;cfdefaultcase&gt; &lt;!--- default code / html here ---&gt; &lt;/cfdefaultcase&gt; &lt;/cfswitch&gt; </code></pre> <p>This is a very simple example, to illustrate the idea of URL rewriting.</p> <p>Addition:</p> <blockquote> <p>I was wondering if perhaps they were using a database query rather than if/else statements?</p> </blockquote> <p>Yes you could.For a query driven results you could do something like:</p> <pre><code>&lt;cfquery name="pageContent" datasource="yourDatasource"&gt; SELECT htmlText FROM pages WHERE page = 'dir/index.cfm' AND content &lt;cfqueryparam cfsqltype="cf_sql_varchar" value="#url.DSECTION#"&gt; &lt;/cfquery&gt; &lt;cfoutput&gt;#pageContent.htmlText[1]#&lt;/cfoutput&gt; </code></pre> <p>If the content is static, and rarely updated, another option would be to look into includes and try to leverage the ability to execute code based on the content.</p> <pre><code>&lt;cfinclude template="./includes/symtoms.cfm"&gt; or &lt;cfinclude template="./includes/#url.DSECTION#.cfm"&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload