Open floppyapple123 opened 7 years ago
You need to provide image
field in all your entries then it will be displayed automatically. Otherwise if you have different field in the object then you can customize it in the layout /views/catalog.html.twig
Is it possible to upload a local file?
Also, when I click on an item, is it possible to link it to a pdf file?
If you open /admin/images and configure AWS S3 then it should be possible to store images. Not sure how stable this feature was. It will be easier I guess if you provide link in your JSON file to external pdf / image
If you customize ./views/catalog.html.twig
and ./src/routes.js
then everything should be possible. This starter is based on http://expressjs.com/
Thanks. But can I link it to a opening pdf instead of going to this page? Thanks so much.
Just open ./views/catalog.html.twig
and find a part:
<div class="items">
{% for item in items %}
<div class="col-xs-3 col-md-3" style="height: 220px;">
<a href="{% if item.permalink %}/item/{{ item.permalink }}{% else %}/id/{{ item.id }}{% endif %}" class="">
<img class="img-thumbnail" src="{% if item.image %}{{ item.image }}{% else %}{{ image }} {% endif %}" alt="{{ item.domain }}">
<p>{{ item.domain }}</p>
</a>
</div>
{% endfor %}
</div>
and then provide a link there to your pdf instead of going to /item/:id
How would I get here on Heroku?
You should run it on your localhost, modify and then redeploy. Not sure how to do it fast but I think this tutorial can be helpful https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction
you already answered my question on linkedin (sorry for asking twice), but thank you so much
now I'm getting an error with the npm install :/ Elasticsearch and MongoDB are up and running
Oh, you are using windows. I've never tried that with windows. It might get more complicated. Ideally if you use linux. Vagrant can help you run a virtual machine i.e. ubuntu on your windows (https://www.vagrantup.com/intro/getting-started/).
You can also try docker composer which starts everything for you out of the box on all operating systems. (https://www.itemsapi.com/docs/starter/installation/). There are some updates thanks to @fbertetto which allows you to edit files locally on your windows and run that easily using docker compose. Not sure how convenient is a development with docker composer though.
Do you have mongodb installed on your localhost ? You can check it out by writing mongo
in your CLI.
Yeah I got that fixed.
On Tue, Jul 11, 2017 at 10:10 AM, Matt Rzepa notifications@github.com wrote:
Do you have mongodb installed on your localhost ? You can check it out by writing mongo in your CLI.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/itemsapi/starter/issues/20#issuecomment-314475754, or mute the thread https://github.com/notifications/unsubscribe-auth/AcFAP2O3vDr_45OjtWKjtG5t_W_PVztOks5sM5BZgaJpZM4OS8O0 .
I got everything to work :), but how do you make a range value with ItemsAPI. Like how would I be able to input data saying that an item has been in use from 2340 to 23948 hours?
Hello @floppyapple123, do you mean range aggregations like:
or
?
Yeah. Also, for some reason I'm stuck on this page when I hit submit, it just takes refreshes the page and does not go on. I created the heroku app by cloning directly from the github page.
Regarding 1) There are some info about aggregations - https://www.itemsapi.com/docs/starter/aggregations/. Usually such a aggregations are created automatically by "understanding" data in the installation process and later you can customize them in the administration panel.
Regarding 2) (Getting stuck on installation page) Heroku logs should provide you more information. You can find them using heroku cli or in dashboard. It can be a heroku problem (i.e. exceeded limit) or some elasticsearch error (some data error).
yeah it seems like an elasticsearch error
Are you trying with a demo items https://raw.githubusercontent.com/itemsapi/itemsapi-example-data/master/items/movies-processed.json or a custom one ?
it works for neither the demo items nor a custom one. The log i attached above is from the demo items
@floppyapple123 it can be a index limit from a Heroku external ES provider. I had such a problem in the past. I was testing now and it's working fine. You can try to remove some of your heroku apps and try again.
Heroku is using https://bonsai.io/ for ES. Maybe there are also some error information in bonsai directly
So is there any way to see that?
On Thu, Jul 13, 2017 at 10:36 AM, Matt Rzepa notifications@github.com wrote:
Heroku is using https://bonsai.io/ for ES. Maybe there are also some error information in bonsai directly
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/itemsapi/starter/issues/20#issuecomment-315115610, or mute the thread https://github.com/notifications/unsubscribe-auth/AcFAP_4J2bC4yLppKUZLFc5cxf8q1f-jks5sNjl7gaJpZM4OS8O0 .
Not sure how to fix it. Maybe there is a limit in index amount and removing some of them will be a solution
I've already deleted all but two apps in my heroku
I've gotten it to run the same way before, i don't know why its messing up right now
Could you try again from scratch https://heroku.com/deploy?template=https://github.com/itemsapi/starter/tree/master ?
Deploying from there works fine. The problem I'm having is that I need to edit the catalog.html.twig file, so I'm getting it locally, by going into CMD and hitting
$heroku login (enter in my info) $git clone https://github.com/itemsapi/starter.git $cd starter $heroku create $git push heroku master $heroku open
Your method is great but I am getting then:
{
"message": "unexpected error - probably mongodb is required"
}
Usually I was using https://heroku.com/deploy?template=https://github.com/itemsapi/starter/tree/master and follow heroku instruction how to run it locally
You will find it in https://dashboard.heroku.com/apps -> your app -> deploy
you have to go into heroku and go into the resources tab and manually add mongodb, bonsai elasticsearch and redis
Nice, very tricky. Ensure you are using ES 1.7 in Bonsai.
When you are using https://heroku.com/deploy?template=https://github.com/itemsapi/starter/tree/master then it's defined in app.json https://github.com/itemsapi/starter/blob/master/app.json
In here:
It is taking ES 5.3.2 probably
my app.json is the exact same as yours
does it work for you?
In this way (when I was adding addons by heroku web interface) no because bonsai created for me ES 5.3.2 version which is not supported and I couldn't find a way to change version..
Hmm yeah its the same for me too. Is it possible to change it?
so is there any way to get itemsAPI locally and run it off heroku?
Probably the easiest way to start (after heroku) is docker composer. Personally the best for me is linux ubuntu. It can be run on localhost with vagrant or also with https://www.digitalocean.com/. You can install all dependencies manually or with preconfigured ansible script.
I emailed bonsai support and got downgraded to 1.7.5 and it works now :)
Wow, that's great about them :)
I see that you updated the Image uploader, but I'm still using AWS right now. It works fine as long as the files are made public, but I want to make it so that itemsAPI can access and display private files.
Hey, yes. How the private files work in AWS S3 - I mean how amazon is making the authentication for the private files (by IP, token) ?
I want to get the pdf icon on all of my entries, but I don't really know how to do so. Could anyone explain how to? I'm running it off of Heroku. Thanks.