#Doutzen Kroes via #Beatrice Hettlage #NYFW 2011

#Doutzen Kroes via #Beatrice Hettlage #NYFW 2011

Thanks to D for his great MPD pictures
birdynumnum:

Sisters (Taken with instagram)

Thanks to D for his great MPD pictures

birdynumnum:

Sisters (Taken with instagram)

An expert is a man who has stopped thinking he knows!

Frank Lloyd Wright

The human race has one really effective weapon, and that is laughter.

Mark Twain

Drupal Views - part IV (Fields configuration)

Through View is possible to manipulate the output in a more semantically correct way, thus we can have a better control of it for theming purposes. In a previous post while talking about displays we learned about the default outputs available within views:
The grid formats the output in a Html grid, with rows and columns; the Html list is a simple option to display the view in an ordered or unordered list; the Table option displays the results in a table, defining the numbers of items presented in a row. The last output is the unformatted list.
The rewrite rules in Drupal provides us with a quick and easy way to markup the output in the format we want. It is important to outline that this can be used to control and edit the row and elements within the view but not the whole view. 
Once a View is created it is easy through Firebug to inspect the element to notice that the fields in it are structured in many divs and spans with complicated class names, e.g. something-views-field-name. With the rewrite option we can achieve a simple hmtl output for the fields belonging to the view. Sometimes the same result can be achieved with the Styling Settings options, wrapping the HTML and Label, but there is a better flexibility in using the Rewrite Output.

It is important to follow the following steps:

  1. Click the first field to access the configuration settings
  2. Check the box Exclude from Display
  3. In the configuration option there is a Rewrite Results section click on Rewrite the output of this field 
  4. It will provide you with more options, but there is a text field where is possible to insert the output code
  5. The View offers replacement patterns that work just as tokens that represent a specific field. The fields available in the replacement patterns are only the ones above the field that is being configured
  6. Given that it will be easier to rewrite all the fields together it is better to exclude all the fields from display and afterwards rewriting the output only for the last field

Another useful option is the Rewrite the Field into Links, that will create a link for the specific field. This can be an outbound link as well as a node internal to the website

City Skater

City Skater

Drupal Views - part II (displays)

Before we dig into the display functionality available with Views it is worth to look into the Base Tables. Every View has a base table, The concept behind the base table relies on the data that will be used for the specific view in question. The base table is available once a new view is created, below the view name the is the Show box. Within the Show the base tables are included, and there are several core options available, the far most used is the Content type, but it is possible to option for the Comments, Revision of the Content, Files, Taxonomy and more. Once we choose the base table a list of subcategories will be visible.

Nodes have much more options and functions available with it, when working with other data types the options will be reduced drastically. 

 It is possible to use different format to work within the same View. This can be accomplished working with displays. Once we create the View we start working on the Master display which is the Page that appears on the top of the View admin panel. It is possible to add more displays that will show the settings selected for the master page. There are several display that is possible to create, blocks, content panes, and more, of course we will choose the one that fits better our functionality need. Once we create the new display it will feature the settings of the master page, this needs to be changed most of the times to adapt the settings for our new display. Any change that will be made will be an override, thus we need to remember that every time we apply new settings we have to select the override option on top of the page, so we will not affect the other views.
When creating new display we need to consider the issues that might be related with the Pager ID, that can be found in the setting of the pager and is usually set to 0. If there is conflict between 2 or more displays of the same view. When this bug comes up it is possible to overcome it modifying the pager, usually it is easier to do it for the secondary display rather than the master page. Thus by accessing the setting of the pager in the other display and change the Pager ID from 0 to 1 it is possible to avoid the conflict. 
Another setting that can be changed is the Ajax of the display, it is by default set on No, so if we switch it to yes it reload the remaining displays without reloading the whole page. 

Among the core displays available a really handy one can be the Feed option, these is an excellent way to create RSS feed based on the content available in the website.

Another display option available is the Attachment display, that allow us to create attachments that will be rendered within another display, not very used.

Different display can have different settings, based on the display created these will be directly related to the page, pane, or block. In general the settings include path, the menu and the access permission info. 

NY is my chess board

NY is my chess board

Drupal Views - part I (Basic Settings)

Now it’s time to work on the most powerful and advanced module in Drupal Land. Of course you will need to enable Views and Views UI, Chaos Tools is required by the system for it but by now you be familiar with its importance.
Once the module are enabled, through the Structure>Views you can access the opportunity that Views offer to Drupalees. The main page is populated with a preset of examples available (e.g. Glossary, Taxonomy, and more). In case we need to create a new View you can create a new set, in this case we will click on Add View. It is important to know which type of nodes will be included in the views. It is a good practice to create a new content type that you would like to feature in the viewwhere you will need to give it a Title, with an optional description, it is also possible to create a page, once we check the box Drupal provides with a number of sensitive options that are already filled. It is also possible to create a menu item for the new view/page created, this make life much easier. Click save and edit, that will bring you to the Admin View Page, at fist glance you might feel a little uncomfortable about it but it is really well built so once you learn more about it the different features it should be quite easy to use in its basic functions.

The settings presents are several:

  • Basic ones: Title, Format, Filter, Sort
  • Page Settings: Path, Menu and Access info
  • Header, Footer and Pager
  • Advance Settings

Let’s take a look to the most important settings. Once we define the content type and the format it’s quite important to understand the Sorting Criteria that will define the order of the items featured in our view.
The Ascending and Descending is quite obvious, so the following sorting order set regards filters that can be set and this can rely on the Content, Comments, Users, Taxonomy and other. Once the criteria are defined it is possible to add more than one and rearrange the order of it click and drag and it is possible to delete them as well.

The following basic settings that we need to understand is the Filter Criteria. Now is time to set the content displayed should be published and the content type that will be fetched. It is possible to select different operators among the ones present in the database. It’s quite immediate to understand the filter features, what  is interesting to look into a little deeper it is the dynamic filter through which we give the user the option to select and arrange the filter that better suits them, but we can look this later on, once we have a better understanding of the View Panel.

Another powerful tool is the Fields (View). Through the fields we can define in a more precise way what we want to display on the view and how we want to arrange them. It is important to select the fields out of the Format setting pane. In the Field configuration setting page we can select a number of important options, such as to link the content with the node associated with the field, if we want to add a label to the field, or exclude it from display and style settings along with option to rewrite the output of the field.
Once we are familiar with the settings available for the Field we can add more fields to the view, the list available is quite comprehensive. A very important one is the Image, due to the fact that can be useful to understand the fully extent of the power of Views. The Image field is preset to have it link with the content and the size of the image, it can also be associated with Colorbox when the module is enabled on the system.

The next element to look into is the the Format of our View. Through the format we can define the style that we want to use for our display. There are several preset displays such as unformatted, html list, grid and others, and it is important to remember that each of this format comes with different settings. Adding more modules will expand the number of format list available to us, the best example will be the use of the Slideshow Module or the jcarousel one. The one that I use mostly is the grid, so I will get more into the details of it. Through the grid format list it is possible to display the number of items on each column. If we are using the grid and other format it is important to learn how to edit the Pager, this will allow us to determine the number of items to show. The other important option is the table that becomes handy when we are working to display lots of data, one of the useful tools that it offers us is to merge different fields in the same column.

Restrictions in life

Restrictions in life