您在這裡

CCK link 問題

bbqpublic's 的頭像
bbqpublic 在 2010-05-11 (二) 15:04 發表

大家好,

我是drupal 新手關於CCK link 問題, 所以想請教一下,
有沒有看過oreilly "using drupal", 我根據書本試了job posting.
有些問題. 想請教.

我做了一個job_post content. 當我post job 之后, 用view做了一個報表型式的頁面顥示所有職位空缺, 現在希望在每一行的后面可以多了一個 "申請" 的按鈕, . 裡面將 nid 和工作類別直接帶到 "申請工作" 這個content type" 裡面的蘭位.

但不知如何做. 平時自家寫的網頁, 我只需要在array print rec 時加一行 link ref 在每行的最后就行了, 但在 drupal
裡就不知怎做.. 我裝了 CCK Link, 但做不到, 因為不知在那設置....

1. 試過在 job post content type 裡新增一個 field = link , 但做不到, 因為根本未有nid, 所以不知甚樣加一條link with query string/ref.
2. 也不可能要用家,每一次在post job 時加這條 link, 沒有人明白怎做..

所以我想應該在print 這個content type 加上去, 但不知怎做. 請指教一下, 謝謝..
我想drupal 一定有它的運作模式. 請指教, 謝謝

regards,
Billy

hello Joe,

我剛查找過 prepopulate module, 應該是答案了, 正在查找這module doc,研究用法.
謝謝你回覆.
但還是不明, "link 到 node/add/content-type" 因為link 本身沒有太多文件關於設定.
可否說多一點要怎做?

謝謝
Billy

可以試試看這個模組 node reference url widget.

假設你有另外一個content type 叫apply_job, 加上一個cck field, configuration :

Type of data to store -> node reference (在cck 模組中, 要先enable)
Form element to edit the data -> reference from url
Referenceable node links 這部分的設定,寫上在job post這個content type的連結要如何顯示。 例如Link title: 申請這工作。

Create link on the teaser view (這是在job post teaser 中是否出現連結)
Create link on the full view (這是在job post full view 中是否出現連結)

Content types that can be referenced: 這是最重要的,選擇job post.

然後你回到job type的content , 就會出現申請工作的連結。

如果要用views, 加上relationship就可以了。

大家好,

試了node ref url, 很方便,易用, 謝謝你
prepopulate 還在究研文件, 但還未知在那頁面更改, 之后再試. ...

Node ref url, 巳成功做了一個link. 按 apply 就可以了.
還有少少問題想請教

問題:
現在當按了apply link 之后, 便帶到 job apply 畫面, 但 node title 還是雖要寫入. 例如按了一份申請"會計文員"的工作, 帶進畫面之后title 還是空的, 它是CCK default , 沒法更改. 應在那修改,是不是一定要直接修改job app node, 如果是, 在那可以做到.

畫面大約如下.

title: CCK default (因為先前按了申請"account clerk", 所以應該將這個 "申請會計文員這個$var 直接帶到 title.)
Job desc: account clerk (這就是先前在職位空缺 按了一下 "account clerk" , 之后帶到 job app. 的頁面, 成 功了)

謝謝
regards,
Billy