ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Please Help! No one seems to be able to answer my question in "How To"

August 19, 2008 8:37pm

Subscribe [4]
  • #1 / Aug 19, 2008 8:37pm

    mikeO

    22 posts

    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

  • #2 / Aug 19, 2008 9:57pm

    Sue Crocker

    26054 posts

    Entries can have more than a single entry assigned to them.

    Category posts are found in the exp_category_posts table, which links a category_id with an entry_id.

    You’d need to do some sort of a query to match up the entry_id of the related entry with the category_id, and then match that up with the categories table to grab the description.

    This really is a howto question and not a technical support question.

    Did this help?

  • #3 / Aug 20, 2008 1:51pm

    mikeO

    22 posts

    It helps, yes - however I really need some help in creating that query…

  • #4 / Aug 20, 2008 4:38pm

    Ingmar

    29245 posts

    Mike, unfortunately this is beyond what we can offer for regular Tech support. Would you like me to move this thread to Howto?

  • #5 / Aug 20, 2008 4:41pm

    mikeO

    22 posts

    i guess… does no one in tech support know how to do what I’m asking? Or can they only answer it if it’s placed in how to?

  • #6 / Aug 20, 2008 4:54pm

    Lisa Wess

    20502 posts

    Hi, Mike -

    I’m going to move this; but as an explanation, what you are asking for is a fairly advanced customization using custom queries that is pretty specific to your project.  If you need help of that type, it is best to look at posting an ad on the Job Board or hiring one of our Pro Net members for customized solutions.

    Thank you!

  • #7 / Aug 20, 2008 5:47pm

    Adrienne L. Travis

    213 posts

    I left a comment on the other post about this that will hopefully help you.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases