0

I have a site with a large number of blog channels (literal blogs in this case).

Each channel has a number of pieces of information I need to associate with it - a summary of the channel, an image that displays as a header, a feedburner link, and a couple other text fields.

Currently, I'm storing that information in a matrix in a low variable, and tying it to the channel manually with a text field containing the shortname of the channel.

The problem is that when I use this matrix a lot (for example on a page that outputs entries from every one of my channels) this matrix ends up being hugely inefficient and boosts my memory usage significantly.

So my question is this - how would you store this type of information that relates to a channel as a whole, not an entry?

  • This sounds like something Stash could help with. Probably going to need to see code for that, however. I'm not sure there is a better way, to store that data to be honest. You could probably do it with categories and category custom fields if you wanted to go native though, that's not as nice as LVs and Matrix of course for you or the client and you won't have all the cool field types available to you. – Natetronn Jan 15 '13 at 7:39
  • Nate - Stash might actually be useful here. I could output this information once into a stash tag, and then, I think, access it later. Just have to figure out the lookups then. I'll have to look into this but it's not a bad idea. – Jacob Russell Jan 15 '13 at 17:50
2

I would create separate channel for channel metadata and store all data related to blogs as entries in that channel. That will give you a lot of flexibility (as usually with channels).

To associate entries with actual blogs you will need a custom field that will store blog channel name or ID. That can be text field - in that case, you will need to enter name/ID manually. Or, if you're familiar with add-on development, you can create dropdown select fieldtype that would present list of channels (you can develop it using similar existing fieldtype as a base, like this)

| improve this answer | |
  • That method is going to be much more inefficient then what I'm doing now. Instead of calling a matrix over and over, I'm calling channel entries over and over. The overhead from that will be an order of magnitude greater, it's the other direction I'm trying to go. – Jacob Russell Jan 15 '13 at 17:49
  • I'd suggest using a query to call the data. – Anna_MediaGirl Jan 15 '13 at 18:26
  • Of course, I forgot about this! I'm curious to see how this will play out and what the extra channel entry tag will do for performance or if you end up combining the two channels into the one channel entry tag's "channel param" (thinking out loud here.) – Natetronn Jan 15 '13 at 18:27
  • No need to say that data in 'metadata' channel can - and should - be cached, as they're not likely to change often – Yuri Salimovskiy Jan 16 '13 at 8:46

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.