Jump to:
| Project: | Featured Content |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | feature request |
| Priority: | minor |
| Assigned: | snyderp |
| Status: | postponed (maintainer needs more info) |
Issue Summary
It would be very handy to be able to include the nodes from view's result set, but then also pad the results with more results from the "Filtered Content" settings to make sure we include the "Number to Show" set number of related items.
Here is a use case this patch fulfills:
I have a content type "publication" that includes a "Node Relation" field that allows a user to specify up to three other related "publications." I have a "Featured Content" block that shows up to 3 "publications." I'd like this block to display any "publications" that the user has specified are related to the current node, but also to use the filter settings to bring in additional nodes when there are less than three related "publications" specified. The specified links should always appear at the top of the block.
With this patch this can now be achieved by:
- Creating a view that shows the publications related to the current node (by passing the argument allowed by this patch: http://drupal.org/node/1101058)
- Setting the featured_content "Filtered Content" settings to show publications with similar terms
- Setting the featured_content block to leave the order as is
- Applying the attached patch and checking the "Prepend view results?" checkbox
This patch adds a "Prepend view results?" checkbox to the featured_content block config page.
Hope this is useful. I tried to document the code changes well. Please let me know if I can explain what I'm trying to do better or anything along those lines.
| Attachment | Size |
|---|---|
| featured_content_append_view_results.diff | 5.45 KB |
Comments
#1
The link to the related patch mentioned above is here : http://drupal.org/node/1101060
If it'd be helpful, I'd be happy to roll a patch that includes both sets of changes.
#2
You are doing a lot of things with views. I'm wondering if you would be better served by sticking just with views instead of using the featured content module + views.
What are the use cases where you find it good to combine these?
I could certainly add this patch but I'm a bit worried about making the UI more and more complicated since the focus of the module is to keep things simple. I think, for one, I'm going to collapse the views fieldset so that regular users won't need to see what's in there since they may get confused.
Thoughts?
Kristen
#3
#4
The reason I added this as a patch than going strictly with Views is that I wanted to use Views to create the first few results in a block, and then rely on Featured Content to fill in any remaining slots to always get (as close as possible) to 3.
The specific use case I'm using this on goes like this:
1. I have a content type 'publications' that has CCK field called 'related publications.' This field can hold zero to three node references to other publications on the site.
2. I want a "related publications" block that will include three other publications. If there are "related publications" specified in the node, they should appear first in the block. The "featured content" rules should be used to fill the remaining 3-0 slots as needed
3. My solution (using this patch) is to create a view that shows the related nodes. I "prepend" this view to the beginning of the featured content block, and then use a couple of the filter rules to fill in the rest of the block
If the above feature(s) sound like useful contributions but the UI is the sticking point, I'd be happy to work on that and try and get it to a place where it seems like a better fit. Just let me know. Thanks!
#5
Subscribing, greetings, Martijn
#6
#7
Subscribing. This sounds like an ideal solution to our use case where we want related content listed automatically on a node type according to our pre-set rules, but with an option to specify the top few links (through a node relationship as described above) - even if they wouldn't normally appear through those rules.
#8
I'm wondering if this could be handled without views by letting you build up multiple featured content block results together.
For example, you build the following FC blocks:
1) manual FC block with nodes 1, 2, and 3
2) cck FC block that pulls nodes from the node being viewed and shows nodes 25 and 15 when viewing node 5
3) filtered FC block that generates nodes 10, 14, and 20 when viewing node 5
Then you build a mega FC block (or whatever to call it) by choosing those 3 blocks above. When it is displayed on the node 5 page, it shows 1, 2, 3, 25, 15, 10, 14, and 20.
Make sense?
Kristen