drupal-views

conflict between views and pathauto

喜你入骨 提交于 2019-12-11 06:38:01
问题 if i create a path alias to a node, say 'press' and i have a view page display on path 'press/archives', why does 'press/archive' leads my users to 'press'? see related Fundamental understanding of how Views and Pathauto work together 回答1: A way around this is to make a custom view with page URL "press" that only retrieves the one node and shows the full node content, so that the URL token is handled by Views and not by the menu system. 来源: https://stackoverflow.com/questions/2914222/conflict

Field Collection RESTful API rendered in HTML

孤人 提交于 2019-12-11 06:03:57
问题 I'm not sure this is a bug or what. But when I create API view page and add field (which is field collection), it rendered HTML instead of 'neat' JSON. For example it should be look like : field_collection_name: [ { "title": "Big Title" "field_a": "content" }, { "title": "Big Title 2" "field_a": "content 2" }, { "title": "Big Title 3" "field_a": "content 3" } ] Instead, the JSON in api view render like this: field_collection_name: <div class="field--name-title">Big Title</div><div class=

Drupal: create a node with employee working hours

陌路散爱 提交于 2019-12-11 00:17:17
问题 I have a bit complicated task. 1. I need to create a node with employee working hours (it's gonna be created for all users with role "employee"), which looks like this: Monday: From __ : __ To __ : __ Tuesday: From __ : __ To __ : __ Wednesday: From __ : __ To __ : __ etc. So, I'll have to create probably 14 CCK fields (monday_from, monday_to, tuesday_from...) or more to store the day of the week and workging hours (hours and minutes). 2. I need to add a view with exposed filters, where

Drupal hook_views_post_execute not getting called

拥有回忆 提交于 2019-12-10 14:15:50
问题 I'm trying to hook into the hook_views_post_execute event in Drupal 7, my module called foo is located in sites/default/modules/features/foo . My foo.module file contains a definition for the hook_views_api function, defined like this: function foo_views_api() { return array("version" => 3.0); } This function gets called, but my implementation of the hook_views_post_execute does not, it's defined (in the same foo.module file) like this: function foo_views_post_execute(&$view) { $seen_rows =

Programmatic Views in Drupal 7

北城以北 提交于 2019-12-10 11:54:43
问题 I'm trying to create two views. View-1 is a list of nodes. View-2 is an image gallery associated with each node. I basically want to pass the node title from View-1 to a programmatic View-2, so that each row in View-1 will load View-2(with a result set filtered by the title of View-1!). I'm confused about the approach. Should this happen in a custom module, preprocess functions, or some combination thereof? I run into this a lot - wanting to pass an argument from a primary view to a secondary

Drupal 7 views Contextual filters with Page & Blocks

我们两清 提交于 2019-12-08 09:33:21
问题 I have an issue and i'm hoping to get some advise. I have a view created that show content based on the url: eg: domain.com/item/one Shows fields for my node with the title one domain.com/item/two Shows fields for my node with the title two etc etc. The path for the PAGE in views is set to /item What I'm having trouble with is I need to have a BLOCK (becuase I'm making it collapsable) show under that page with the specific URL show the body field for that node. eg: domain.com/item/three Shows

Load view template on module activation

别来无恙 提交于 2019-12-08 07:53:34
问题 I have developed a blogger-like archive feature (you know, from the feature module). I want to edit the .module file in order to automatically load the view-template (which is bundled in the feature) into the theme. Is there a way to do it? 回答1: On a general level: you should think " features = modules " and leaving theming for... themes! This does not mean that you shouldn't include a template with your feature, but that you should evaluate whether the template you have built suits a general

Is it possible to change order of attachment views to drupal page view?

冷暖自知 提交于 2019-12-08 03:05:45
问题 I have a view with a page display that contains essentially content A, that content exists in one column. in addition, I've got another 6 attachment displays that display content B,C,D,E, etc. in another column. Is it possible to modify the order of the the attached view displays? Right now i've got them all set to attach after Content A Page. 回答1: I am not 100% sure I understand what you are asking. So what I think you are trying to do is have a page with a view, then multiple views attached

dynamic view by date arguments in drupal 7

半世苍凉 提交于 2019-12-07 20:21:13
问题 I'm new to drupal, currently im stuck with this problem. I want to create a article view ("tip of the day") wherein the content of the will automatically changed accordingly. The default value would be the current date. For example: http://localhost/test this will get the current date as the default filter. If no items found it will give no results found. when i go to http://localhost/test/20111220 the view will automatically get the value of the date parameter in the url and output the

How to publish data residing in an external database using Drupal? [closed]

别等时光非礼了梦想. 提交于 2019-12-07 05:00:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm very new to Drupal and was getting a bit of mixed information about views so I wanted to see if anyone can set me on the right path. Here's my situation. I have a separate database (on the same Drupal database server), that has a lot of data that's maintained by another team. We want to publish that data to