2

I'm looking to combine three different channels on the homepage, ordered by date, unless the client rearranges the hierarchy in the CP.

Low Reorder for EE had this customization, where entries would come into the plugin ordered by date, but you could drag and drop entries to the top if you wanted to rearrange the hierarchy.

Craft Structures is close, but 1) I need to combine three different channels into one hierarchy, and 2) these channels will grow immensely over time, so Structures will become cumbersome.

What are my options, if any? Is there a Low Reorder-type plugin out there?

  • Does it have to be three different channels or would refactoring these into one structure with three different entry types be an option? – carlcs May 26 '15 at 14:00
  • I suppose that could be an option, but may disrupt the URL format. Each channel has it's own URL format: channel1/slug, channel2/slug, etc. Each channel has a different set of categories as well, but I don't think that poses a problem. – John Johnson May 26 '15 at 14:05
  • No categories is not a problem, you have a dedicated set of field for each entry type. And you can have individual URLs per entry type as well by making use of dynamic routes. – carlcs May 26 '15 at 14:10
  • Or even simpler: buildwithcraft.com/help/entry-type-urls – carlcs May 26 '15 at 14:11
  • So there's only your concern left with a structure section getting unmanageable over time. Not having used Low Reorder or EE in general, what would be the advantages of that plugin over using a Craft structrue? – carlcs May 26 '15 at 14:16
1

For me this looks like a perfect fit for one structure with different entry types for each of your content types (text, video and recipes). Each entry type can have it's own set of fields, so there's no difference to individual channels (with one entry type each).

You can simply have the entry type's handle in your URIs, as the {type} tag is available in section URL settings (→ see help article), or you'd set up custom dynamic routes.

Via the entry's entry.type property you can include individual template partials for each entry type on your index page:

{% for entry in craft.entries.section('blog') %}
    <li>
        <h2>{{ entry.title }}</h2>
        {% include '/blog/_partials/' ~ entry.type %}
    </li>
{% endfor %}

Same for your _entry.html file:

{% include '/blog/' ~ entry.type %}

And I've heard that structures with many hundreds or thousands of entries is no problem for the control panel. I think it was Craft 2.0 that had many optimizations in that respect.

|improve this answer|||||
  • This seems like a great solution if I do go the Structure route. Still a bit concerned about having it all in one section when you can't organize by Entry Type in the CP. And could having just the one section be overkill just to accomplish a sorted section of the homepage? – John Johnson May 26 '15 at 16:33
  • You can have them sorted by entry type in the CP, making use of hooks from a very simple plugin. Have a look at modifyEntryTableAttributes, getEntryTableAttributeHtml and modifyEntrySortableAttributes; example code is here on SE. You could even have them separated into custom views selectable from the sidebar with modifyEntrySources. The php code to do this is a little bit more complex, but there's example code in form of P&T's CategorySources plugin. Or just use that plugin and have your entries listed by your category groups? – carlcs May 26 '15 at 17:11
  • It appears that Structures default to ordering in Ascending order in the CP. Is there a setting to have it default sort in Descending order? – John Johnson May 26 '15 at 19:13
  • Oh damn, I hadn't thought of that. Hmm, I actually do not know a way, but I can remember someone asking P&T to implement this. Are you on Craft Slack? – carlcs May 26 '15 at 19:18
  • Just registered. – John Johnson May 26 '15 at 19: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.