2

Is there a way of linking a custom field to any entry of your website. I've found this add on http://devot-ee.com/add-ons/entry-layout but it's not compatible with matrix. Thanks Geoff

4
  • 1
    Do you mean that you want to show/hide one or more custom fields based on which entry you're currently editing (as opposed to what channel you're in and/or what field group is assigned to that channel)? Jan 4 '13 at 13:35
  • 1
    Hi Geoff, could you give us a few more details about your use case? From the little you've told us it strikes me that there may be a better solution depending on how you've set up your channels. Assuming you want per-entry field groups as Derek asked, it may be the case that those entries shouldn't be part of the same channel. Sometimes EE's flexibility can lead you down a few unnecessary rabbit holes... Jan 4 '13 at 18:14
  • 2
    As the others have said, more detail is required, because another possibility that occurs to me reading the brief description is that you want to relate one entry to another in which case you could use a relationship field, but that may not be what you're intending.
    – Tyssen
    Jan 5 '13 at 12:08
  • Sorry for being vague. I want to be able to add a New Channel Field to a channel which only appears on a particular entry of my choosing. E.g. Let's say you had a channel for pages with a title field and body field. I want to use this channel for an entry but needs a matrix field for content. How do I get this to show only on this entry?
    – Geoff
    Jan 7 '13 at 17:20
2

To me it sounds like you might be defining your content too broadly (on a 'page' level instead of on a more atomic 'content' level). However, we still don't know enough to say whether this is the case, and you may just prefer to keep with the page paradigm anyway, so here are some options depending on your use case:

  1. Instead of matrix rows, use entries in a separate channel and then use template logic to pull in those entries on the appropriate URL.

  2. As above but integrated with Shortcode add-on so that the author can decide where the extra entries appear instead of hardcoding it in template.

  3. Take a look at Content Elements add-on. This add-on looks impressive but scares me a lot... (I think you're better off breaking up your content into small tightly defined chunks instead).

  4. Write a quick and dirty extension using the cp_js_end hook - This allows you to inject your own javascript into the control panel, so you could probably write something simple that hides the Matrix on all but the right edit page. Could get a bit dangerous for future maintenance.

Also, since the Entry Layout add-on seems to do exactly what you want anyway, it may be worth enquiring as to whether Matrix is in fact supported - many add-on developers are over cautious about claiming compatibility if it hasn't been tested... or it could be a simple oversight, or it could also be the case that Devot:ee added that compatibility feature after this add-on was originally uploaded.

0

I suggest taking a look at the Better Pages add-on. It allows you to choose between different page "types" or "layouts", and will hide/show different fields based on which layout is currently selected for that particular page/entry.

Or, you could simply add instructions for your client to the Matrix field: "(only applies to the XX page)". That solution is quick, easy, and free.

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.