I am currently trying to add a static image into an Odoo v10 report.
In Odoo v8, I used the image tag with the path like this:
<field src="/my_module/static/src/img/my_image.png"/>
But in Odoo v10 it does only display an empty rectangle.
Has it been changed in v10 or am I doing something wrong?
The path and the name of the file is correct.
Greetings, Matthias
First of all image you want to display is static image not the field so try image tag:
<img src="my_module/static/src/img/my_image.png'/>
This is working for me to display a background image:
<div class="page" t-attf-style="background-
image:url('/my_module/static/src/img/my_image.jpg');">
Make sure that when you go to (your server's url)/my_module/static/src/img/my_image.jpg in your browser, you can see the image.
So you could do an empty div with your image as background in the place you want your image.
Related
I'm showing images from resources/static/images/
The weird thing is if I give the path like "/images/milk.png", it shows the image but if I get name from ${}, it doesn't work.
<img class="card-img-top"
th:src="#{/images/${res.getLogo().getUploadFileName()}}"
th:alt="${res.getLogo().getUploadFileName()}" />
it seems res.getLogo().getUploadFileName() is working well. So it will be replaced like /images/milk.png. But it doesn't show the image...
How can I fix this?
One more thing, I know basic Thymleaf path is resources/templates, but how it recognize image when I gave like "/images/milk.png"
If u want to upload static images
th:src="#{images/} + ${res.logo.uploadFileName}"
if you want to upload dynamic images
th:src="#{https://~~~.com/} + ${id}
For the <title> I've followed this SO answer This is working perfectly for part but the image is not working
Laravel dynamic page title in navbar-brand
But, Here when I try to make an image dynamic instead of title it's giving me a text instead of an image.
For instance,
header.blade.php
#yield('image')
In another blade, I called image as in section
#section('image', '<img src="http://localhost/appname/public/front/images/heading.png">')
Every page has a dynamic logo so I want to put logo dynamic the same like we're doing in the title.
But the result I'm getting is
<img src="http://localhost/appname/public/front/images/heading.png">
You can do like this
#section('image')
<img src="http://localhost/appname/public/front/images/heading.png">
#endsection
I'm using Pinterest for my web site here : http://www.encadrement-art.com/galerie.htm
My source image is a thumb image, so the "pin it" button does not show any image in this page.
But when I use the data-pin-media attribute (for the first image in this page), the "pin it" button does not show the image yet.
What is the problem ?
it needs to have the full path in data-pin-media, not the relative path, eg <img src="./01-min.jpg" data-pin-media="http://www.example.com/01-min.jpg" />
Thank you for your help .... but it does not works ... :(
The minimum size of my src image must be 200X200px ... al my thunmbnail are in 150x150px :(
I am using Carrierwave to upload images in rails4.
In the html view page the image is showing. But, when generating the pdf, from this view, the image is not showing.Instead , a blank box is showing.
From the view, while inspecting the path is showing as below:
<img alt="Small images" src=" http://127.0.0.1:3000/upload_
files/6/student/image/1/small_images.jpg">
The code i used is:
<%=image_tag Student.find(id).image_url(:small) %>
If the image is stored in app/assets/images, then the images will appear.But, i need to upload the image in this location only.
Can u pls help...
Thanks in advance.
I could do it with php Laravel this way >>
<img alt="Small images" src="{{base_path().'path/to'image.jpg'}}">
I have no experiences with Ruby , but try to find something similar.
I am creating a website for the first time with Bootstrap3 and have a page with 3 images which will be links to galleries. These images are not thumbnails.
I have alternative images (B+W) for hovering and so my code currently changes the image from colour to B+W on hover.
I want to be able to also include a text overlay on hover so people will know to click through to the gallery. So, I'm looking to add text on hover to the B+W image. Alternatively, I would make the colour image less opaque and add text to that, if it's easier!
Here's my html code currently.
<img src="landscape.jpg" alt="Landscape" onMouseOver="this.src='landscapebw.jpg'" onmouseout="this.src='landscape.jpg'" class="img-circle img-responsive">
Thanks in advance.
try adding a title attribute :
<img src="landscape.jpg" alt="Landscape" onMouseOver="this.src='landscapebw.jpg'" onmouseout="this.src='landscape.jpg'" class="img-circle img-responsive">