I want to creat a dynamic external link where the dynamic part comes from a custom input field

ex http://www.thisSite.com/[field_newest]/pageID

I've tried putting the above in the default field, but it doesn't work. I'm guessing that may be because it validates the link before it includes the field or it could be that I just don't know how to make it work.

Help, please

Connie

Comments

quicksketch’s picture

Tokens don't work on the URL field. Regarding setting default values, you can't set a default of a field based upon another field in the same form, since the field used as a token hasn't yet been filled out yet either. To accomplish the default value you're wanting, you'll probably have to use PHP to set the default.

conniec’s picture

Thanks for the reply. Now to dig out my PHP manuals. My programming is SO weak.

Connie

conniec’s picture

Title: Dyanmic external link possible? » Dyanmic external link possible? --cck, php and views

If I enter this PHP snippet at the bottom of the cck text field

if((aray) $field_number ['value] >= 120
{
print "This is big";
}else {
print "This is not big';
}

and then, in Views, I add field text:number to my view, I get the original number and not the statement. I'm not really sure where the php output ends up?

Help, please.

Connie

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of activity. Sorry you were unable to receive an answer conniec.

minus’s picture

Version: 5.x-2.3 » 6.x-2.5

Helo

I'm working on a project where I need a field with a default url. The client fills out the form a combination of the default url and what the user submits should be the final url

Default setting for the link field should be something like this: http://www.link.com/#, when the user submits his form, the field should be http://www.link.com/#*****, and display on the node like "go to website"

Really need this function and hope you can help me :)

Morten|Norway

minus’s picture

Status: Closed (fixed) » Active

open this thread again :-/

jcfiala’s picture

I'm tempted to mark this as a duplicate of #412404: CCK link should take token as part of URL - Could you look at that and comment on it?

minus’s picture

Status: Active » Fixed

got it to work with views

content field and select "Output this field as a link", add the url and Replacement pattern: http://example.com/[field_your_field__value]

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.