我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Drupal路径模式令牌if / then

I would like to do something like

if [node:subtitle] is available make the path pattern 
[node:title]-[node:subtitle]
else 
[node:title]

What is the best way to do something like this?

You can't do it with the pathauto module I'm afraid, it simply doesn't have this functionality. You'd have to implement hook_node_presave() and change the path manually for each node you want to do this for.

近期文章

  • 在PHP5中解析复杂的XML
  • 在Codeigniter上创建库时出错
  • 如何从表中检索列值到PHP变量?
  • 检索1个链接到数据库中所有值的值
  • 如何通过php中的系统命令替换exec()?
  • 使用“$或”条件无效
  • 在sql / php中选择日期和日期(其他格式)之间的所有内容
  • 使用PHP将视频发布到用户Facebook墙
  • Mysql在缺少html图像时创建双重插入
  • 使用PHP将^ M字符转换为空格而不使用换行符
  • 跨服务器AJAX请求 - 适用于除IE之外的所有浏览器
  • php邮件功能不起作用
  • 如果php中的语句使用日期
  • svn checkout无法使用php exec()
  • 从php中的jquery检索数组值
  • jquery ajax成功没有显示数据
  • 正在下载空文件
  • CakePHP访问find('all')数组
  • Drupal视图模板
  • 将多个项目作为一个项目插入到db中

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华