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.

Using categories variable pair within related categories mode

October 09, 2011 12:30pm

Subscribe [2]
  • #1 / Oct 09, 2011 12:30pm

    Jonathan Schofield

    175 posts

    Think I can guess at why this doesn’t seem to be supported but here we go…

    I’ve got 2 category groups going for different purposes, let’s call them group 1 and 2.

    I’m using group 2 as a means to many:many relationships output via related_categories_mode (I would prefer not to have to resort to using Playa).

    But within the related categories output I’d like to output a category being used in group 1.

    So I tried some code as follows…

    {exp:channel:entries channel="grades" related_categories_mode="yes" custom_fields="yes"}
      {if count == 1}
      <section id="grades" class="grades">
        <h2>Related grades</h2>
    <p>    <ul><br />
      {/if}<br />
          <li><a href="http://{title_permalink=grades}">{categories show_group="1" limit="1"}{category_name}{/categories} _Alloy <span class="model">{grade_model}</span></a></li><br />
      {if count == total_results}<br />
        </ul><br />
      </section><br />
      {/if}<br />
    {/exp:channel:entries}

    But the categories variable pair doesn’t work inside related categories mode—I guess because of performance issues?

    Is there any other way I could get at the group 1 category in this context? Maybe I should try a query tag. Or I guess I could create a custom field that duplicates the group 1 category choice.

  • #2 / Oct 10, 2011 10:12am

    Mark Bowen

    12637 posts

    Hi Jonathan,

    You are correct in your assumption that categories won’t work when a Channel Entries Tag is put into relationship mode. This can be seen in the Channel Entries Tag documentation here - http://ellislab.com/expressionengine/user-guide/modules/channel/parameters.html#related_categories_mode.

    There may be an add-on available on http://devot-ee.com which could help with this or yes as you mention a SQL query might be a way to go with this too.

    Unfortunately both of these routes fall outside of our support scope and so I’m going to need to move this thread over to the Community Help forums for you. It may well be that an ExpressionEngine user has done this sort of thing before and so will be able to help you out on this one.

    Thanks,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases