Here is what I have, and what I would like to do is in ALLCAPS in the link path (I need to get the category name of the linked entry there). Can anyone help me achieve that? FYI - the path uses single quotes instead of double because the code tag keeps stripping it out with double quotes…
{exp:weblog:entries weblog="graphics-projects" limit="1"}
<div id="main">
<h1>{title}</h1>
<ul class="relatedProjects">
<li>{related_entries id="client"}Client: <span>{title}</span>{/related_entries}</li>
<li>Related Projects: {exp:query sql="SELECT exp_weblog_titles.title as my_title, exp_weblog_titles.url_title as my_url_title
FROM (exp_relationships INNER JOIN exp_relationships AS exp_relationships_1 ON exp_relationships.rel_child_id = exp_relationships_1.rel_child_id) INNER JOIN exp_weblog_titles ON exp_relationships_1.rel_parent_id = exp_weblog_titles.entry_id
WHERE (((exp_relationships.rel_id)={client}) AND exp_weblog_titles.weblog_id=4) ORDER BY exp_weblog_titles.entry_date"}
{if my_url_title != segment_3}<a href="http://{path=/graphics-projects/CATEGORY_NAME_HERE/}">{my_title}</a>{/if}
{/exp:query}</li>
</ul>
{related_entries id="client"}{if client_body}<h3>About {title}:</h3>
<p> {client_body}{/if}{/related_entries}<br />
<br />
</p><h3>About the project:</h3>
<p> {project_body}<br />
</div><!-- end main --></p>
<p>{/exp:weblog:entries}So I would like to query the category of each of those related entries, so that I can add that entry’s category name to the link path (category name is same as template name) - otherwise the links to those entries don’t work… I’m not too savvy with sql queries - I received help for the one written above - so any help is appreciated! thx