Drupal 7.x. 如何添加自定义“阅读更多”链接到主页块
2015年9月22日
本教程展示了如何进行更改 Read More link 定制一个 Drupal 7.x..
Drupal 7.x. 如何添加自定义“阅读更多”链接到主页块
-
First, log into Drupal back-end 并检查分配给block的内容:rollover block并单击 Edit View link. 下查找内容类型 过滤条件 heading.
-
接下来,导航到 Structure -> Content types -> {your content type} -> Manage fields tab:
-
填写两个字段: Add new field and 选择字段类型. 将最后一个设置为Link. 用于编辑数据的Form元素 字段将自动更改为链接,单击 Save button:
-
在下一个屏幕上单击 保存字段设置 button.
-
在下一个屏幕上配置新的链接字段:编辑字段标签, 设置字段为Required, 选择链路类型, 将默认值设置为 link target, CSS类和标题. 保存字段配置.
-
现在您应该添加新的字段block:导航到 主页- Block,翻转块,点击 Edit View link. Under the Fields 点击标题 Add button:
-
In the Add fields 弹出窗口,将您的新字段名称插入 Search,在搜索结果中检查新的字段名称,然后单击 应用(所有显示) button:
-
完成后,你会被转到 配置现场屏幕, click the Style Settings tab. Check the Customize field HTML option, select DIV in the HTML element menu. Check the 创建一个CSS类 选项,并将类插入 CSS class field:
-
接下来,禁用与主页块一起设置的默认阅读更多链接.
-
在块中,单击 Content:Link option. 在弹出选项中,选中 从显示中排除 field. Next, open the Style settings tab 在相同的弹出窗口中复制其 CSS Class. Click the Apply button.
-
现在打开添加到块中的新字段并粘贴 CSS class into it.
-
最后一步是向内容中添加新字段. Navigate to Content,过滤内容 Type 使用对应字段,单击 Edit link:
-
Scroll the Node editor 向下查找您创建的新字段,填写 Title and URL fields. 点击Save changes按钮,并在前端检查new button link:
请随时查看下面的详细视频教程: