Flag Content right from a View

I installed the Views for PHP module. 33k installs and somehow I missed this. Then, I found this great post on how to use the Global:PHP “field” to add PHP that will allow for a Flag entry right on the View.

This gives me a nice simple way to bookmark content. Very nice. The screecast tells you all you need to know. Plus, the info given can have many applications. VERY COOL.

Thanks to the guys at http://projectricochet.com for the info.

Image

https://drupal.org/project/views_php – Module

http://projectricochet.com/blog/how-add-flag-link-drupal-view#.Ubjpque1Fns – Screencast on adding the PHP using the Views PHP module

Advertisements

Keep Views results IN the Panel

I have everything built in Panels. So, by default, a View with an exposed filter will show its results in the View URL rather than the Panel URL. So all the nice Panel elements will disappear. So, I go to the Panel config for the View and add what you see below. I had to add the URL of the Panel itself and not the View. This will keep the results of the View iwthin the Panel after the exposed filter has been changed.

View URL – tn/views/search-news-archive – wrong; loses Panel elements

Panel URL – tn/pages/search-news-archive – correct; keeps the results in the Panel

Image

Views

Today, I am going to spend some time learning more about Views. I think that understanding Views is critical. Not just the basics, but the overall capabilities so that when you do your initial Views design you can make that it is going to scale properly, give you the max flexibility later. I’ll be doing a lot of reading and will post some of the things that I find.

First thing. I have 15 Views for Aggregator items from RSS Feeds. Each View is filtering a category. But, if I delete the individual Views, create one Master View and create subviews under the one Master View, then I keep the UI tidier and I have better control over all those categories’ Views because the Master CAN override the individuals. That way I can make global changes. At least, that’s the thought.

Header

Global: Result summary (Results Returned) – i wanted to have this but didn’t know where. Shows the total of a Views based query. I expose the Body in the Filter Criteria and then allow the user to input text to search for. it now show number of results.
Pretty happy with this. And using a hierarchical style of creating Views is a good idea because of the centralized control.
I have some other things that I am going to do with Views later but for now, I’m good. On (back) to Multilingual.

Views – searching for data

So, I have all these emails from the court system. And I want to be able to search through them pretty easily. I simply expose the filter criteria for the body and the operator as well. But what i need  to do is search through everything on the whole site…..

Views – A better way to show different versions of the same content.

I believe that the Views module may be one of the smartest parts of Drupal. Since I have my full html emails coming in properly now, I’ve moved to Views to get them to display the way that I want.

I create one Master View for the content type of TNCourts, the custom CT I created for the Mailhandler stuff. Then, I create page-based overrides for the individual versions. So the titles of the content pieces (each email is a separate piece of content) reflect how I want them arranged. So each version of the master has all the same filter criteria but the title. that differs just a bit and I reflect that difference in the filter criteria. I then create a new page path and menu title for each version. Here is a SS:Image You can see in red where the differences are. This is much better than creating a separate View for each way to display. I just had to play with it a lot to “get” that aspect of the product. But then again, I am an idiot.

Aggregator categories, Views, Feeds, Panels and a solution

I am very happy today. I finally found a solution to the issue that I was having with Views and Aggregator items from the core mod. Aggregator is core, Views is contrib so this patch doesn’t involve hacking the core but be aware that an updated version of Views might break this again. I’m on Views 7.x.3.5

Here is the issue.

In Views, you can create a view for Aggregator items. But even though Categories is listed as an available field to add/filter against, it is not available unless the category field is used as the default category for that feed. when you go through the items and categorize them manually, that assigned category won’t show up in the View. this patch fixes that.

http://drupal.org/node/498438#comment-7063554

This is what I have. 20 RSS feeds from news sources all over the state. This is a catch all and I am only interested in certain stories. So, I have categories created to group the stories that I want together, regardless of the source. Every item that comes in has a default category of New. That way, I can see all new items together for categorization. This all works. It’s a pain, I have to look at about 40-50 items per day and categorize each one. But it is a big deal because I am dealing with a focused target audience. A niche. And stories that deal with their situation are import and need to be easy to get to.

So, I also need the power of Views. Views gives me much better presentation options when used by Panels than the Blocks interface does. Blocks is clunky and Panels is much better. And Views integrates well with Panels.

Now, you might ask, “why not use the Feeds Module?” well, i did. for hours and hours. and while it will do what I want, it is much more difficult for me (AT MY PRESENT LEVEL OF UNDERSTANDING*) to edit, categorize and tag individual nodes created by Feeds for each new news item. That takes a lot longer. And until I can write a module that does autotagging the way that will work for my type of content, I need to be able to use the Aggregator categories they way they are intended.

So, I implemented the patch. And it does work. I had to do it manually because code has been added since the patch was written to the Views mod and the line numbers are different. But it is really short. I’m on Views 7.x.3.5, Core 7.19. The patch goes into the modules/aggregator.views.inc file within the Views folder.

If you want to see why Views doesn’t work properly with Aggregator ietms read the post. the explanation is in there. This was a really frustrating experience but like all of those types of experiences, I am better off for it.

Views, Feeds, Aggregators and aggravation

I’ve had a few frustrating days with Drupal this week. Hence, the dearth of new posts. A word of warning though: don’t make too many assumptions about Drupal when you’re getting your “sea legs”. There are many, many ways to do things. and some that appear to be promising are frequently blind alleys. I think the best piece of advice that I could give right now would be to KISS – keep it simple stupid. Drupal is already complicated enough. Don’t go out of your way to make things any more difficult than they need to be.

  • Learn Views inside and out (it’s the saving grace of Drupal)
  • Have a dev/sand environment
  • be patient and creative. think around drupal problems and not through them

that’s it for now. going to try to get these feed imports to work the way i need them to work.