对Views和Pathauto如何共同努力的基本了解 [英] Fundamental understanding of how Views and Pathauto work together

查看:99
本文介绍了对Views和Pathauto如何共同努力的基本了解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在理解何时使用路径规则以及何时使用视图页面路径时遇到基本问题。我有几种自定义内容类型,我正在使用块来显示某些路径上节点的某些部分。然后我使用视图页面来显示路径上的主节点。

I am having fundamental problems understanding when to use a pathauto rule, and when to use a views page path. I have several custom content types, and I am using blocks to display certain parts of nodes on certain paths. Then I use a views page to display the main node on a path.

当我这样做,我不能使用pathauto,因为它覆盖了我设置的路径观点。例如,如果我设置了location /%的视图页面路径,并为location / [title-raw]的位置内容类型设置了一个pathauto规则,当我浏览到mysite.com/location/mylocation pathauto胜利,并且只显示完整的节点。如果我不能使用pathauto,我不能在我的块上添加参数,因为Drupal不明白它在看什么! Arrrg!

When I do this, I can't use pathauto, as it overrides the paths I set in views. Eg.. If I set up a views page path of "location/%", and set a pathauto rule for Location content types of "location/[title-raw]", when I browse to mysite.com/location/mylocation pathauto wins, and simply displays the full node. And if I can't use pathauto, I can't add arguments on my blocks, because Drupal doesn't understand what it's looking at anymore! Arrrg!

我已经尝试安装Util,并改变了模块的重量,但没有起作用。但是,我不应该像改变模块的重量那样做任何疯狂的事情,对吧?在我的想法中必须有一些基本的缺陷。

I've tried installing Util, and altering the weight of the modules, but that didn't work. But I shouldn't have to do anything crazy like alter module weights, right? There must be some basic flaw in my thinking.

如何保持你的路径和内容的组织?

How do you keep your paths and content organized?

帮助我像水一样流动,帮助我成为杯子。

Help me flow like water, help me become the cup.

推荐答案

好的,我解决了我的问题。我应该问的实际问题是:

Ok, I've solved my problem. The actual question I should have asked was:

如何显示单个节点?

我基本上是使用视图来构造单个节点。当然这不是Views的设计目的。查看有类似问题的其他人:

http://drupal.org/node/400400
http://drupal.org/node/316907

I was basically using Views to style a single node. Of course, this is not what Views is designed for. See others with similar problems:
http://drupal.org/node/400400
http://drupal.org/node/316907

我的解决方案:


  • 让路易斯做所有的工作。

  • 根据需要在主题
    图层上添加,排列和设计您的内容。

更多的话:删除视图页面查看,使用相应的位置/%路径。按照你想要的方式设置你的路径规则。将node.tpl.php复制到您的主题目录。重复该文件并将其重命名为node- [type] .tpl.php。更改节点 - [类型] .tpl.php而不是在视图中设置规则。

In more words: remove views page view, taking the corresponding location/% path with it. Set up your pathauto rules the way you want. Copy node.tpl.php to your theme directory. Duplicate that file and rename it node-[type].tpl.php. Alter node-[type].tpl.php instead of setting up rules in Views.

有关更多帮助,请参阅特定的CCK内容类型,请参阅:

http://drupal.org/node/266817

For more help theming a specific CCK content type see:
http://drupal.org/node/266817

别忘了!
当使用phptemplate node- [type] .tpl.php建议时,还必须有一个原始的node.tpl.php模板存在于您的主题目录中,否则模板建议将被忽略。

Don't forget! When using phptemplate node-[type].tpl.php suggestions, there must also be an original node.tpl.php template present in your theme directory or the template suggestion is ignored.

希望能帮助别人!

这篇关于对Views和Pathauto如何共同努力的基本了解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆