ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

images & css location problem

April 24, 2012 8:44am

Subscribe [1]
  • #1 / Apr 24, 2012 8:44am

    mehdi ghazi

    7 posts

    I have a problem with the images and css location
    a view named home.php ,this view is a xhtml document it linked external css and there are images and other external content
    this images location on the codeigniter folder is on the style folder.
    I load this view on a controller named home.php
    the problem is show the page without images and no css style
    I look at the images location I find the url of the images is http://localhost/codeigninter/home.php/home/index/image.png
    how I set the correct location on the view?

  • #2 / Apr 24, 2012 8:57am

    vrencianz

    60 posts

    Move the images and styles inside the codeigniter’s root folder like ‘static/images’ and ‘static/styles’ then replace all references from the view to

    <link href="<?=base_url()?>static/styles/style.css" rel="stylesheet" type="text/css" />
    <?=base_url()?>static/images/image.jpg

    for example. The same with js files.

    Hope this approach helps.

  • #3 / Apr 24, 2012 11:04am

    InsiteFX

    6819 posts

    Sure that will work if he has php short tags turned on! Most user do not use them any more.

    <link href="<?php echo base_url('static/styles/style.css');?>" rel="stylesheet" type="text/css" />
    <?php echo base_url(

     

  • #4 / Apr 24, 2012 11:39am

    mehdi ghazi

    7 posts

    on seting the base_url()the content of the page has been hidden

  • #5 / Apr 24, 2012 12:28pm

    mehdi ghazi

    7 posts

    Sure that will work if he has php short tags turned on! Most user do not use them any more.

    <link href="<?php echo base_url('static/styles/style.css');?>" rel="stylesheet" type="text/css" />
    <?php echo base_url(

    it get the correct url of the images but for show an image we need the location of the image not his url
    how I get the correct location???

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases