A field which lets you add a complete link to your content types; including URL, title, and optionally a target attribute.
Requires the content module(CCK)in
Drupal 6, or the fields module (core) in Drupal 7.
The link module is a one-stop content link "field" type for CCK/field. It provides three fields to an authorized user:
-
URL (textfield)
-
Title (textfield)
-
Open New Window (checkbox)
-
Add rel=nofollow attribute
"Title" and "Open New Window" can be optionally enabled or disabled when setting up the content field.
Link
module is not necessary to add links to the navigation or primary menus. Links added to the navigation or primary menu can be done with menu module (part of Drupal core). Visit admin/build/menu on your site to configure menu and navigation links. Use
Link module if you need to have users enter in a URL that is relevant to a piece of content being added.
If you were to create a field named 'My New Link', the default display of the link would be:
<div
class="field_my_new_link" target="[target_value]"><a href="[URL]">[Title]</a></div>
where items between [] characters would be customized based on the user input.
Installation
-
Drop the entire link module directory into your 'sites/all/modules' folder
-
Enable the module from the Administration area modules page (admin/build/modules)
-
Create or Edit a content-type and add a new field of type link (admin/content/types in D6, admin/structure/types in D7)
Configuration
Configuration is only slightly more complicated than a text field. Titles for links can be made required, optional (default), or left out entirely. If no title is provided, the trimmed version of the complete URL is may be displayed.
The target attribute may be set to _blank, top, or left out completely.
The rel=nofollow attribute prevents the link form being followed by certain search engines. More info atWikipedia.
Data Entry
Link supports both internal and external URLs. URLs are validated on input, here are some examples of data input and the default view of a link:
Anchors and query strings may also be used in any of these cases, including:
node/74971/edit?destination=node/74972
<front>#pager
Theming
For Drupal 6 you can find more information on how to theme the output (and all other CCK fields) at theCCK
Handbook on Theming Individual Fields
Another popular alternative is usingContent
Template Module, which allows you to output links (or other field types) in any variation using PHP code. Almost any formatting desired can be accomplished using one of these two methods.
For Drupal 7, I need a link for one or more pages which describe how to theme the output.
Help
If you have questions or trouble, please post to theissue
trackerrather than the forum.
Help, my Query String / Fragment disappeared!
If you're printing out the contents of a link field like such:
<?php
print
$node->field_example_link[0]['url'];
?>
you'll only see the basic url. To get the whole url, try this:
<?php
print
$node->field_example_link[0]['display_url'];
?>
相关推荐
drupal theme学习笔记,在学习主题制作中觉得很有用的文档
cck 2.1 for drupal6 cck 2.1 for drupal6 cck 2.1 for drupal6
零起点学习Drupal教程零起点学习Drupal教程零起点学习Drupal教程
drupal安装使用笔记,含drupal安装和所见即所得编辑器fckeditor在drupal里的安装
drupal cckdrupal cckdrupal cckdrupal cckdrupal cckdrupal cck
全书五大部分,七十多个小节,涵盖了几乎drupal的方方面面。
drupal学习资料包 内含十五个资料 Beginning Drupal 7.pdf Drupal 6 Social Network.rar drupal 6手册.chm Drupal 7 Module Development.pdf drupal-7.15.zip Drupal6主题开发指南 .pdf Drupal_工作原理解析.docx ...
Drupal 入口级学习文档 初学都必备 清晰PDF
自己在学习中整理的一些资料 包括drupal源码、汉化包、使用手册、常用到的网站
drupal学习总结.doc
drupal学习总结2.pdf
这是一个drupal模块,drupal官网可以下载,这里只是为了换积分换积分啊
包含:Drupal7宝典; Drupal开发指南; Using Drupal(强烈推荐) 值得你下载!
Drupal dataDrupal data
如何安装使用drupal,drupal各个模块使用小结,flashvideo添加本地、远程视频...
内含两个资料:drupal7专业开发指南 中文版,Drupal宝典
Develop your programming skills by creating engaging websites using Drupal 8 About This Book Explore the new features of Drupal 8 through practical and interesting examples while building a fully ...
"Enterprise Drupal 8 Development: For Advanced Projects and Large Development Teams" English | ISBN: 1484202546 | 2017 | 309 pages | PDF | 9 MB Successfully architect a Drupal 8 website that scales ...
drupal6的安装,drupal6的安装drupal6的安装drupal6的安装