How to quickly view a topic?

I defined a view with the CCK and View 2 modules. I would like to quickly identify a template specific to that view. Any tutorial or information on this? What files do I need to change?




Here are my findings: (Edited)

There are actually two ways to view the topic: path < "and node . In" edit View "you can choose" Row style: Node "or" Row style: Fields ".

  • using node ", you can create node -contentname.tpl.php that will be called for each node in the View. You will have access to your cck field values ​​with $ field_name [0] ['value']. ​​(edit2) You can use node -view-viewname.tpl.php , which will be called only for each node displayed in this view.
  • using the Field parameter, you add a view-view-viewname field - field-name-value.tpl.php for each field that you want individually.

Thanks to the previous answers, I used the following tools:

+84
drupal drupal-views cck drupal-theming
Sep 16 '08 at 22:02
source share
10 answers

There are actually two ways to view the topic: path < "and node . In" edit View "you can choose" Row style: Node "or" Row style: Fields ".

  • with node ", you can create node -contentname.tpl.php that will be called for each node in the view. You will have access to your cck field values ​​using $ field_name [0] ['value']
  • using the Field parameter, you add a view-view-viewname field - field-name-value.tpl.php for each field that you want individually.

Thanks to the previous answers, I used the following tools:

+50
Sep 16 '08 at 22:55
source share

A quick way to find template files that you can create and modify for presentation in Views 2.0 is:

  • Change view
  • Choose a style (e.g. page, block, default)
  • In the "Basic settings" section, click "Subject: Information" to view all the various templates that you can change.
+21
Sep 16 '08 at 23:27
source share

Devel module The Theme Developer feature is useful for viewing the template files that Drupal searches for when it comes to a topic. See the screenshot on this page for an example.

+15
Sep 17 '08 at 0:20
source share

You should also check Semantic Views . For simple Views, they are really convenient.

+9
Jul 28 '10 at 4:12
source share

One tip:

You will likely have several views that require similar formatting. Creating templates for each of these types and copying them creates a code branching nightmare - if you are asked to change the whole appearance of the site (meaning changing the display of each of these types formatted in this way), you must go back and edit each of them separately.

Instead of using the views interface to select new templates for views, I sometimes just insert some code branches into a single views file. For example. for one site in views-view-fields.tpl.php I have:

 if($view->name == 'articleList' || $view->name == 'frontList' || $view->name == 'archiveList') { /* field formatting code */ } else { /* the default code running here */ } 

Then it changes the fields the way I want only for this family Views = articleList, frontList and archiveList, and for other views using this template, the code that is usually found in this template is executed. If a client asks: β€œHey, could you make these pages showing archives and this list on the first page to look bigger (...)”, it’s just a matter of opening and editing this one file instead of three different files. Maintenance becomes much faster and friendlier.

+6
Mar 24 2018-11-11T00:
source share

for me block-views-myViewName-myBlockId.tpl.php works

+5
Oct 21 '09 at 0:50
source share

My quick access option.

  • Go to the theme.inc file in the YOUR_MODULE_DIR / views / theme / folder.

  • In the _views_theme_functions function _views_theme_functions print the $ themes variable or place a breakpoint in the last line of the function to see the contents of the variable.

Just convert views_view to views-view and __ to - and add a template extension to get your desired file name.

For example, if the element of the $ themes views_view__test_view__block (where test_view is the name of your view), then the name of the template file will be view-view - test_view - block.tpl.php .

+4
Aug 08 '09 at 10:22
source share

In my opinion, the easiest way to decide which template file to use for viewing views: 1) Click on admin / build / views / edit / ViewName β†’ Basic settings β†’ Theme

Clicking on this will list all possible template files. Highlighted (file names in bold) indicate which template file is used to create the theme, which part of the presentation. After including the necessary changes in the corresponding RESCAN view template file .. now you can see the modified template file.

+2
Feb 21 '10 at 16:48
source share

If you want to quickly develop Drupal with lots of drag and drop, select Display Suite module def. this is what you should use: http://drupal.org/project/ds

+1
Sep 01 '11 at 10:11
source share

In my opinion, there are two ways to do this:

Program way:

  • Go to the editing window.
  • Select a page / block style.
  • Go to "Basic Settings" and click on "Subject: Information" to see all the various templates that you can change.
  • Add the html you want the theme to and print out the view variables wherever needed

Configuration Update: Using the Display suite The Display set gives us the ability to place your labels inline or higher and add them even to hide them. Custom classes for each view element can also be added. Extra options:

  • exported
  • Add your own fields to the backend or to your code
  • Add custom layouts to your theme (D7 only)
  • Change labels, add styles or redefine field settings (semantic fields).
  • Full integration with views and panels
  • Boost the power of your layouts with Field Group
  • Optimal performance when integrating an object cache (D6) or integrating with an object (D7)
0
Jan 24 '17 at 4:19 on
source share



All Articles