By savithac on
global $base_url;
$picture = '/sites/default/files/image1.jpg';
$form['image'] =array(
'#type' => 'markup',
'#markup' =>'<div class="image">
<a title="contents" href=$base_url/?q="node/1">
<img title="contents" alt="contents" src=$base_url.$picture>
</a>
</div>',
);
The image path does not redirect "node/1" and Pictures also not displayed.
$base_url and $picture variables are not consider in html code.
When i gave the path directly, the page will be redirect to "node/1" and "image" also displayed in that page.
But i want to assign variables as a link?
Comments
Use theme wrapper and l()
To avoid using $base_url, please have a look at http://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_ima... on how to user theme('image', ...). A link can be created by using l() which is documented here => http://api.drupal.org/api/drupal/includes%21common.inc/function/l/7
Thanks Mr.McGo , It works.
Thanks Mr.McGo , It works.