I am trying to get the image URL inside Edit Theme Files -> product.html
I already have some values like:
{{product.title}}, that gives me "Product name"
{{product.url}}, that gives me the URL
etc...
but no matter what i try, i can't get the URL.
The closest I got was using this: {{product.main_image.data}}
which gives me something like this:
https://cdn3.bigcommerce.com/s-8lxh1/images/stencil/%7B:size%7D/products/882/1700/RAM_VB_193_SW1__09586.1463668242.jpg?c=2
But that does not produce a image link.
Would appreciate any help or insights.
Thanks in advance!
The string that you're returning doesn't work because there's a "size" placeholder embedded in the URL. You can use Stencil's getImage Handlebars helper to specify the image dimensions and return a working URL:
{{getImage product.main_image.data "thumbnail"}}
The "thumbnail" string specifies an image size that exists in your theme settings. You can also specify a numeric size, like "200x200". Check out the docs here
Related
I was creating a controller to gets information from custom module and wonted to display the pdf or image on the website how to get the url.
I was able to download it using this
return http.send_file(maybefiel, filename='sdsdds', as_attachment=False)
but I wonted to display it can you please help
You can access a binary field using the following path:
your_url/web/content/model_name/id/field_name
For example, the field name of a user's profile picture is called "image", so, the URL looks like something like this:
http://localhost:8069/web/content/res.users/1/image
Where 1 is the user id.
I am trying to retrieve data from cloudSearch, searching for the word "Person" and adding the following filter:
(prefix field=claimedgalleryid '')
The problem is that I don't know how to create the URL using that exact filter.
Could someone give me a suggestion or some link to Amazon documentation related to this topic?
What I've tried and didn't work:
...search?q=Gallerist&size=10&start=0&fq=(prefix%20field=claimedgalleryid%20%27%27)
...search?q=Gallerist&size=10&start=0&filter=(prefix%20field=claimedgalleryid%20%27%27)
You were close with your first attempt--it looks like you forgot to URI encode the = sign as %3D. Try this instead:
&fq=(prefix+field%3Dclaimedgalleryid+'')
I highly recommend using the "test search" feature to work out the kinks in your query syntax. You can see the results right there, and then use the "View Raw: JSON" link to copy the full request URL and see how characters get escaped and such.
I have the URI to an image stored in a database. I created a dataset, which contains the image location. When choosing the location of the image I used a script which says this.uri = row[location],
however the image is not rendering and I am getting an error which says the rsource could not be reached. Is what I am trying to do possible in Birt, or is there any way to dynamically set the uri?
Thanks in Advance
You should not have to use a script to do this.
I assume this image is embedded within a table bound to the dataset. If it is not, you just have to select the dataset in the "bindings" tab of the image. When the image is correctly bound we have to:
Select the image -> properties -> reference -> edit
Set the option "select from URI", and for "Enter URI" expression don't forget to switch from "constant" to "javascript syntax".
With the expression builder select your dataset column within "Available column bindings" and here we go!
If you still have an issue check the URI generated with your web browser console.
We can get some information by json.
But how can i get images by the information in json.
e.g. "thumbnail": "medivh/1/1-avatar.jpg"
It does not work when i concat the url behind the host + request.
So, is there some other way to get images?
The url for the static images has the following format:
http:// REGION . battle.net/static-render/ REGION / THUMBNAIL
Example:
For the avatar image
http://eu.battle.net/static-render/eu/alexstrasza/57/51685945-avatar.jpg
The picture you see when you visit your armory profile
http://eu.battle.net/static-render/eu/alexstrasza/57/51685945-profilemain.jpg
Another angle, I don't know where this is used
http://eu.battle.net/static-render/eu/alexstrasza/57/51685945-inset.jpg
As of the latest changes to the static renderer, the following is correct:
http://render-<Region>.worldofwarcraft.com/character/<Thumbnail>
For example:
http://render-us.worldofwarcraft.com/character/kul-tiras/148/130814612-profilemain.jpg
I am currently trying to build my first Safari extension. The SafariBrowserTab Class has a Method called "visibleContentsAsDataURL".
I don't exactly understand what it does and can't get it to work.
The docs just say: "Returns a data URL for an image of the visible contents of the tab."
What does it mean? That I get the URL of a screenshot of the tabs' content back? Can someone explain me?
Thanks!
I think it returns what is effectively a screenshot of the tab. The format is explained here
http://en.wikipedia.org/wiki/Data_URI_scheme
According to Apple's Safari reference documentation the return value is "a base-64 encoded PNG."
A data URL is a specal type of url basically consisting of a mimetype and data, in the case of png you'll get something along the lines of:
data:image/png;base64;lotsofstuff
You can then do whatever you want with it (it's just a string), or if you want to display the content:
img = new Image();
img.src = someTab.visibleContentsAsDataURL();
someElement.appendChild(img);
or
someCanvasContext.drawImage(img);
etc