Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

creating a hrdcoded image link with a feild


3 Posts   926 Views


8 July 2008 at 1:58am Community Member, 78 Posts

I have two advert images on a website homepage which are displayed by two image uploaders and I have also created two text feilds where I want to put an external website address. Is it possible, within the to use the textfeilds to link the image? Here is what i have:

<a href="http://$Left_Advert_Website">$Left_Advert</a>

$Left_Advert_Website is the text feild for the site
$Left_Advert is the image

However when i hover over the image it displays" http:/// and on clicking I get the message: "The URL is not valid and cannot be loaded"

Am i trying to do the impossible or is there anyway of resolving this issue - ideally i do not want to hard code the URL


8 July 2008 at 12:40pm (Last edited: 8 July 2008 12:42pm), Forum Moderator, 5511 Posts

Yep it is certainly possible to do - $Left_Advert_Website probably hasnt been correctly saved. What you might have to do is wrap the variable in a {} to prevent it being interpreted as $Left_Advert_Website".. so you would have <a href="http://{$Left_Advert_Website}">. But first off you need to make sure Left_Advert_Website exists


8 July 2008 at 8:48pm Community Member, 78 Posts

OK im a noob!
When creating the fields I first build the imagefeilds so that I could work on the visuals and get the page styling right. When it came to creating the textfeilds my natural instinct put them with the imagefeilds in the static $has_one = array rather than static $db = array. Whoops!

Thanks for your help willr