Any drupal experts? -- Passing CCK reference to another CCK object as an argument
Hi Would anyone know how to pass the reference of one CCK object to another CCK object during object creation as an argument? (cck = content creation kit) Ex: If i have two cck content types A and B with the following fields. A ( aid, some field) B (bid, aid, somefiled) so that every B is related to an A. When creating a new B object, how can I a pass the reference of an existing A object (ie an 'aid') via an argument (through the URL)? [ this should happen without the user having to enter it manuall -- i.e when the user clicks a particular URL a chosen aid shuold be passed ] Tnx in advance Srimal.
I'm not using CCK, but the nodereview module does something similar for "normal" nodes. A nodereview node is not available via node/add, but is available to be created/edited via a tab on other nodes, and is dependent upon it. Check how it's doing that, and see if that may help. On Thursday 22 June 2006 01:08, Srimal Jayawardena wrote:
Hi
Would anyone know how to pass the reference of one CCK object to another CCK object during object creation as an argument? (cck = content creation kit)
Ex: If i have two cck content types A and B with the following fields.
A ( aid, some field) B (bid, aid, somefiled)
so that every B is related to an A.
When creating a new B object, how can I a pass the reference of an existing A object (ie an 'aid') via an argument (through the URL)? [ this should happen without the user having to enter it manuall -- i.e when the user clicks a particular URL a chosen aid shuold be passed ]
Tnx in advance
Srimal.
-- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson
i thiunk you might need prepopulate.module in order to send that related node in the querystring. see http://drupal.org/node/55310 Srimal Jayawardena wrote:
Hi
Would anyone know how to pass the reference of one CCK object to another CCK object during object creation as an argument? (cck = content creation kit)
Ex: If i have two cck content types A and B with the following fields.
A ( aid, some field) B (bid, aid, somefiled)
so that every B is related to an A.
When creating a new B object, how can I a pass the reference of an existing A object (ie an 'aid') via an argument (through the URL)? [ this should happen without the user having to enter it manuall -- i.e when the user clicks a particular URL a chosen aid shuold be passed ]
Tnx in advance
Srimal.
Thanks all.. BTw is there a good way to add a link (using internal syntax???) without doing it like this. <a href=http://localhost/drupal/?q=node/add/content-review > ??? can i just give the local path using some function? (eg: ode/add/content-review ) ? tnx in advance srimal. On 6/22/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
i thiunk you might need prepopulate.module in order to send that related node in the querystring. see http://drupal.org/node/55310
Srimal Jayawardena wrote:
Hi
Would anyone know how to pass the reference of one CCK object to another CCK object during object creation as an argument? (cck = content creation kit)
Ex: If i have two cck content types A and B with the following fields.
A ( aid, some field) B (bid, aid, somefiled)
so that every B is related to an A.
When creating a new B object, how can I a pass the reference of an existing A object (ie an 'aid') via an argument (through the URL)? [ this should happen without the user having to enter it manuall -- i.e when the user clicks a particular URL a chosen aid shuold be passed ]
Tnx in advance
Srimal.
Check the l() function. On 6/26/06, Srimal Jayawardena <srimalj@gmail.com> wrote:
Thanks all..
BTw is there a good way to add a link (using internal syntax???)
without doing it like this. <a href=http://localhost/drupal/?q=node/add/content-review
???
can i just give the local path using some function? (eg: ode/add/content-review ) ?
tnx in advance
srimal.
On 6/22/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
i thiunk you might need prepopulate.module in order to send that related node in the querystring. see http://drupal.org/node/55310
Srimal Jayawardena wrote:
Hi
Would anyone know how to pass the reference of one CCK object to another CCK object during object creation as an argument? (cck = content creation kit)
Ex: If i have two cck content types A and B with the following fields.
A ( aid, some field) B (bid, aid, somefiled)
so that every B is related to an A.
When creating a new B object, how can I a pass the reference of an existing A object (ie an 'aid') via an argument (through the URL)? [ this should happen without the user having to enter it manuall -- i.e when the user clicks a particular URL a chosen aid shuold be passed ]
Tnx in advance
Srimal.
tnx i installed the prepopulate.module and enabled it in admin/modules. can u give an example on the usage? for ex: i need to pass the value "book1" to the variable 'Book' to when creating a review object type . But the following did not work http://localhost/drupal/?q=node/add/content-review?Book=book1 tnx in advace. Srimal. On 6/22/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
i thiunk you might need prepopulate.module in order to send that related node in the querystring. see http://drupal.org/node/55310
Srimal Jayawardena wrote:
Hi
Would anyone know how to pass the reference of one CCK object to another CCK object during object creation as an argument? (cck = content creation kit)
Ex: If i have two cck content types A and B with the following fields.
A ( aid, some field) B (bid, aid, somefiled)
so that every B is related to an A.
When creating a new B object, how can I a pass the reference of an existing A object (ie an 'aid') via an argument (through the URL)? [ this should happen without the user having to enter it manuall -- i.e when the user clicks a particular URL a chosen aid shuold be passed ]
Tnx in advance
Srimal.
try edit[Book]=book1 .... this question is more appropriate for the prepopulate issue tracker. if noone answers there, try the support forum at drupal.org. Srimal Jayawardena wrote:
tnx
i installed the prepopulate.module and enabled it in admin/modules.
can u give an example on the usage?
for ex: i need to pass the value "book1" to the variable 'Book' to when creating a review object type . But the following did not work
http://localhost/drupal/?q=node/add/content-review?Book=book1
tnx in advace.
Srimal.
On 6/22/06, *Moshe Weitzman* <weitzman@tejasa.com <mailto:weitzman@tejasa.com>> wrote:
i thiunk you might need prepopulate.module in order to send that related node in the querystring. see http://drupal.org/node/55310
Srimal Jayawardena wrote: > Hi > > Would anyone know how to pass the reference of one CCK object to another > CCK object during object creation as an argument? > (cck = content creation kit) > > Ex: > If i have two cck content types A and B with the following fields. > > A ( aid, some field) > B (bid, aid, somefiled) > > so that every B is related to an A. > > When creating a new B object, how can I a pass the reference of an > existing A object (ie an 'aid') via an argument (through the URL)? [ > this should happen without the user having to enter it manuall -- i.e > when the user clicks a particular URL a chosen aid shuold be passed ] > > Tnx in advance > > Srimal. > > >
On 6/28/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
try edit[Book]=book1 .... this question is more appropriate for the prepopulate issue tracker. if noone answers there, try the support forum at drupal.org.
Yes, something like http://www.drupalsite.org/node/add/blog?edit[title]=this is the title&edit[body]=body goes here which comes directly from the README.txt file for prepopulate.module. Scan through the HTML of the page you're trying to fill, looking for the form elements and pass their names and your values along on the URL. I have not yet tested this module with the CCK, but I suspect it will not work because of the form walker code needs work: http://drupal.org/node/55403 Patches welcome, of course. :) -- e www.eafarris.com
participants (5)
-
eric Farris -
Khalid B -
Larry Garfield -
Moshe Weitzman -
Srimal Jayawardena