1

I have an issue I’ve never run into before. I’ve recently started scheduling posts for the future on a site and I have a reverse related entries tag (EE 2.5.5) that is showing these future entries and I can’t make it not do that. It’s pretty essential that this tag not show future entries and the reverse related entries tag (again, EE 2.5.5) does not seem to accept the show_future_entries parameter.

Any help would be appreciated.

3

Reverse related entries does support six of the typical parameters "channel", "status", "sort", "orderby", "offset", "limit".

So parameter "show_future_entries" wouldn't be supported.

***** EDITED *******

You can fulfill you need with SQL in Query module with the following code example:

{exp:channel:entries channel="channel_name1" limit="xx"}
    {exp:query sql="SELECT GROUP_CONCAT(CAST(rel_parent_id AS CHAR) SEPARATOR '|') AS parent_ids FROM exp_relationships WHERE rel_child_id='{entry_id}'"}
        {embed="temp_grp/tmp_name" parent_ids="{parent_ids}"}
    {/exp:query}
{/exp:channel:entries}

Now in template "temp_grp/tmp_name", put the channel entries tag like:

{exp:channel:entries channel="channel_name2" entry_id="{embed:parent_ids}" limit="xx" show_future_entries="no"}
    <p>{title}</p>
{/exp:channel:entries}

Now, you can pass all the parameter of channel entry tag including show_future_entries.

I hope, it would work for you.

2
  • Right, I mentioned that the tag does not accept that parameter. So are you saying there is no way to tell reverse related entries to not show entries from the future? Because if that’s the case, that may be one of the worst oversights in EE I’ve ever seen. Why would I want a reverse related entry to show a post that hasn’t appeared on the site yet? – TJ Draper Jun 13 '13 at 15:34
  • hmmm .... there is a way with SQL in query module and embedding a template. See my edited answer. – Bhashkar Yadav Jun 13 '13 at 17:05
1

Just to expand on Bhashkar's explanations, I see two other solutions on top of what he mentioned:

You could upgrade to EE 2.6.1 which will automagically convert your old relationship fields to the new (more powerful) one shipped with 2.6. That new one will let you deal with future entries or only past entries (albeit in the custom field settings rather than at the template level if I remember well).

Another option would be to use Playa by Pixel & Tonic and convert your relationship fields to that. Playa will give you fine grained control over your relationships, great flexibility and an awesome UI in the CP (in my opinion, a better one that the default relationship field I mentioned above).

4
  • Thanks Jerome!!! Yes, your both solutions will work perfectly in case TJ would like to upgrade EE or use Playa relationship field. – Bhashkar Yadav Jun 14 '13 at 8:11
  • Trying to put every solution on one page for future reference ;o) – Jérôme Coupé Jun 14 '13 at 8:14
  • :) I would suggest TJ either upgrade EE to 2.6.1 or can use the Query which I posted in answer. As with the new relation field of EE2.6+, there wouldn't be need for Playa field. – Bhashkar Yadav Jun 14 '13 at 8:29
  • Well, playa offers several interesting things compared to the native field: better UI, coparents, etc – Jérôme Coupé Jun 14 '13 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.