⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Image tag Issuse



Assem Abdul-Mahmood
  • profile picture
  • Member

Posted 11 July 2013 - 15:29 PM

Hello everyone,
i found grocery CRUD very helpful for me. thank you all for developing  it.
But I got an issue and I couldn't figure it out , please help
my problem as following :

I tried to put a logo image inside my view, such

<header>
  <img src="assets/imgs/logo_en.gif"/>
</header>

when the view loaded for the first time its appear but when I navigate between other links it's the only  disappear while other tags still appear.

i want it in my header, fixed, wherever I go inside my website
please find the attached pic to see.

 

by the way iam using a stable, last updated version of grocery CRUD.

thank you in advance for helpe.


davidoster
  • profile picture
  • Member

Posted 12 July 2013 - 05:36 AM

Hello and welcome to the forums [member=assem abdul-mahmood].

 

What you describe is a CodeIgniter issue on how you define your views and has nothing to do with the Grocery CRUD as a library.

 

I suggest you read this post first, /topic/1660-remember-to-use-the-codeigniter-manual/

 

 

P.S. Maybe you mean </head></head>?


Assem Abdul-Mahmood
  • profile picture
  • Member

Posted 12 July 2013 - 12:28 PM

thanks you very much Grocery CRUD Ninja for your reply .

What i meant is , how to put a logo in Example.php page header ? , after dowloading the library i tried to  re-design the Example.php view to put the logo in it's header . I added a header  selecter inside the Style tage in the view then i but my <img > tage inside header selector to apply the CSS.  It appears for the first time but when

 i navigate it disappear. i don't know why, maby as you siad it has no relation to CRUD library. but if you don't mind try to help me if you know how  can i  custmize the css inside the view to put a header with logo and paragraphs inside the view.

 

thatnks in advance  


davidoster
  • profile picture
  • Member

Posted 13 July 2013 - 08:25 AM

Upload or share the code from example.php so we can help you.

But strictly speaking this is a CodeIgniter (HTML and maybe PHP issue).


Assem Abdul-Mahmood
  • profile picture
  • Member

Posted 14 July 2013 - 06:55 AM

I have no code in my controller; I am just using default code that comes with it.
In my example.php view I have updated css style that comes by default with it, in order to by like other pages in the project. I added the following tags selctors
header{
    width: 80%;
    height:50 px ;
    color: #FFFFFF;
    background-color:#9A9B9A;
    margin-right:auto;
    margin-left: auto;
    padding: 10px;
    overflow: hidden;
    border: 4px;
    border-radius: 4px;
    -moz-border-radius: 2px
    margin: 0 auto;
    clear: both;
    padding: 2em 2em;
    position: relative;
    top: px;
}
header nav
{
    position: relative;
    left:70%;
    ;
    height:100 px ;
    top: 50 px;
    z-index: 100;
}
header a {
    text-decoration: none;
    font-size: 14px;
    color: black;
    margin:3px;
    padding: 3px 10px 4px 10px;
}
a:hover
{
    text-decoration: underline;
}
table, td, th
{
border:1px dashed;
}

section{
    
    width: 80%;
    height: 80%;
    position: relative;
    background#FFFFFF;
    margin-right:auto;
    margin-left: auto;
    padding: 10px;
}
 

Then I put the menu in those tags like

<body>
    <header>
        <img src="imgs/logo_en.gif" />
        <nav>
        <a href='<?php echo site_url('examples/customers_management')?>'>Customers</a>
        <a href='<?php echo site_url('examples/orders_management')?>'>Orders</a>
        <a href='<?php echo site_url('examples/products_management')?>'>Products</a>
        <a href='<?php echo site_url('examples/offices_management')?>'>Offices</a>
        </nav>
   </header>

    <section>
        <?php echo $output; ?>
    </section>
</body>

 

the image tag always disappear when i navigate between those links. and that's the problem.   

 

What I am planning to do is
extending and customizing one css style where I can apply it for all CRUD grocery pages instead of default css  ; but i couldn't do that. please tell me if there is a way to so. 


davidoster
  • profile picture
  • Member

Posted 14 July 2013 - 09:53 AM

On the outputed html code does the <img> code appears?


Assem Abdul-Mahmood
  • profile picture
  • Member

Posted 15 July 2013 - 11:59 AM

I don't get your question . 

but if i opened the view source code of the page i found this :

</head>
<header>
    <div><img src="assets/imgs/logo_en.gif"/></div>
    </header>
<body>

    <div>
        <h1>hello there</h1>
        
        
<a href='http://localhost/CRUD/index.php/examples/customers_management'>Customers</a> |
        
<a href='http://localhost/CRUD/index.php/examples/orders_management'>Orders</a> |
        
<a href='http://localhost/CRUD/index.php/examples/products_management'>Products</a> |
        
<a href='http://localhost/CRUD/index.php/examples/offices_management'>Offices</a> |
        
<a href='http://localhost/CRUD/index.php/examples/employees_management'>Employees</a> |        
        
<a href='http://localhost/CRUD/index.php/examples/film_management'>Films</a> |
        
<a href='http://localhost/CRUD/index.php/examples/activities'>activities</a>
    </div>
    <div style='height:20px;'></div>
<div>
         </div>
</body>
</html>

 

and the Image is there. 


davidoster
  • profile picture
  • Member

Posted 15 July 2013 - 18:16 PM

Then your CSS is playing tricks! It might be the z-index that hides the image.

Check your CSS again.


Assem Abdul-Mahmood
  • profile picture
  • Member

Posted 19 July 2013 - 01:26 AM

you totally right Ninja, the problem with CSS , I believe it's from  the URL of the background  image. while iam searching about the problem through the internet i found someone saying " When a CSS file requests a background image file, the request is relative to the location of the CSS file, not the page you are viewing" .  then I used the developer of Chrome browser to see the URL , you can check the attachment to see the screenshot.   

 

for the first time it use this url  http://localhost/newglocery/imgs/logo_en.gif.  from<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />

 

but when i navigate, i think it's change the URL so the image broken. and I have no idea how i can solve it.

and i have no idea how i can upload the pictures  


davidoster
  • profile picture
  • Member

Posted 19 July 2013 - 07:57 AM

Check your css again. Put in comment lines that might be responsible for not showing and see what happens.

Do it via the developer tools of Chrome, it's easier. 

 

P.S. This code you posted <link ...> is tottally wrong. You must have done changes that are not right somewhere.

Check your code again. And by the way no attachment was found as you mentioned.

 

P.S. What do you mean you don't know how to upload pictures?

 

Suggestion: zip all of your code and send it to me as a private message to have a look. Definitely you do something weird there.


Assem Abdul-Mahmood
  • profile picture
  • Member

Posted 19 July 2013 - 11:46 AM

Here is the pictures. I think i used quick replay  yesterday for that there was no attachment option . 


davidoster
  • profile picture
  • Member

Posted 19 July 2013 - 12:08 PM

Check the path of the two attached icons the one that does work (second image) doesn't have the Cfs subfolder.

Maybe this is the problem?