Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 985011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:06:10+00:00 2026-05-16T05:06:10+00:00

I’ve added some html code in my Blocks content and enabled Full HTML filter.

  • 0

I’ve added some html code in my Blocks content and enabled Full HTML filter.

I’ve used relative paths for my images, such as “sites/all/themes/zen/zen/image.png”

I guess this is not correct because I need to change my paths depending on I’m in the home page or “node/id” page.

I guess I cannot use PHP inside blocks, thus I cannot use $base_url… how can add images path with only html ?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:06:11+00:00Added an answer on May 16, 2026 at 5:06 am

    The previous answers provide a part of the solution, but here’s a fuller scoop:

    Hand-written HTML

    If your site lives at example.com (i.e. it’s the “root” site), then adding a front slash to your relative path will solve the issue, as others have suggested:

    <img src="/sites/all/themes/zen/zen/image.png">
    

    However, if your site lives at example.com/my-drupal-site, then you’ll need to write it like this:

    <img src="/my-drupal-site/sites/all/themes/zen/zen/image.png">
    

    It really is better if you can use PHP to determine the appropriate path. If you’re calling an image from a theme, you can use the Drupal function drupal_get_path to get the path like this:

    $img_path = drupal_get_path('theme', 'zen') . '/zen/image.png';
    

    And then you could be really Drupaly about it and use the theme_image function to generate the HTML for the image:

    $img = theme('image', $img_path, 'My Image - Alt Text', 'My Image - Title Text');
    

    Where $img now holds the HTML for the <img> tag and its src, alt, and title attributes. See the API documentation for drupal_get_path and theme_image for more information.

    Point-and-click Solution

    As jeffreymb points out, your easiest bet is to use a combination of a WYSIWYG editor and a built-in file handling module called IMCE to gloss over all these details for you. If you don’t have access to the “PHP code” input format, this is the best solution.

    So, steps:

    1. Install the WYSIWYG module, as well as a WYSIWYG editor (I suggest CKEditor).
    2. Install the IMCE module and IMCE WYSIWYG Bridge module, and enable the IMCE button for your WYSIWYG editor in its configuration settings for available Buttons.

    See this post for a little more detail on that setup process, and make sure to read the documentation that the WYSIWYG module displays on its configuration page.

    Once you have IMCE installed and integrated with your WYSIWYG, when you click the “Image” button in your WYSIWYG toolbar, your normal dialog should appear but with a new little icon to open the IMCE file browser. This file browser allows you to browse your files folder for images or to upload new files. It also supports a modicum of image manipulation, and will automatically generate the necessary HTML once you’ve selected an image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 535k
  • Answers 535k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can't restart a Thread. From the documentation : Throws… May 17, 2026 at 1:08 am
  • Editorial Team
    Editorial Team added an answer OK. A work colleague finally figured this out. {There is… May 17, 2026 at 1:08 am
  • Editorial Team
    Editorial Team added an answer <?php $arr = array(); $json = '{"productid" : "prod:a8f2d4ef-108e-5fbf-fa74-595ddc0c7950","memo" :… May 17, 2026 at 1:08 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.