I’m using MSM to manage two academic lab sites both being hosted on the UCLA server. I’m working from an EE2 non-commercial license.
In one section of the site, we list a number of researchers that are partners of the lab, along with their bios and photos. Here is the page:
http://cple.psych.ucla.edu/index.php/cple/researchers
On this page, the researchers are presented in alphabetical order (by last name). However, I also want to create links on the page that allows users to view the researchers organized by their discipline, as well as a link that allows the user to view by geographical region.
In the backend, I’m using FF Matrix for the content, with each row being one researcher’s information. Within each row, there is a cell for the researcher’s discipline and another cell for the researcher’s region.
So I then created a page for the researchers content sorted by discipline, and I used conditional statements to organize the content. Here’s the code:
{exp:channel:entries channel="researchers"}
<h1>People: {title}</h1>
{embed='embeds/subnav2'}
<h3>Business</h3>
<p> {researchers}<br />
{if "{discipline}" == "Business"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<h3>Communications</h3>
<p> {researchers}<br />
{if "{discipline}" == "Communications"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<h3>Criminology</h3>
<p> {researchers}<br />
{if "{discipline}" == "Criminology"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<h3>Economics</h3>
<p> {researchers}<br />
{if "{discipline}" == "Economics"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<h3>Law</h3>
<p> {researchers}<br />
{if "{discipline}" == "Law"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<h3>Political Science/Politics</h3>
<p> {researchers}<br />
{if "{discipline}" == "Political Science/Politics"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<h3>Psychology</h3>
<p> {researchers}<br />
{if "{discipline}" == "Psychology"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<h3>Social Work</h3>
<p> {researchers}<br />
{if "{discipline}" == "Social Work"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p><h3>Sociology</h3>
<p> {researchers}<br />
{if "{discipline}" == "Sociology"}<br />
<table class="people"><br />
<tbody></p>
<p><tr><br />
<td class="people_name">{name}</td><br />
</tr></p>
<p><tr><br />
<td><br />
<div class="fltlft">{photo}</div>{bio}<br />
{if "{website}"}<a href="http://{website}" target="_blank" rel="noopener">Website</a>{/if}<br />
</td><br />
</tr></p>
<p></tbody><br />
</table><br />
{/if}<br />
{/researchers}</p>
<p>{/exp:channel:entries}However, when I try to preview this page, I get a Proxy Error. Here is the error message:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /index.php/cple/by-discipline.
Reason: Error reading from remote server
It seems to be overloading the server somehow - because when I take off the last conditional statement, the page loads fine - albeit very slowly.
Is there a way to workaround this? Or to condense/rewrite the code so it doesn’t take so much processing power, avoiding this error?
Thanks very much in advance.
Best,
Larissa