These are chat archives for reactioncommerce/reaction

17th
Feb 2017
Vigy
@vigyano
Feb 17 2017 00:12
where to place plugin custom images and how to access or import it?
Brent Hoover
@zenweasel
Feb 17 2017 00:13
unfortunately there’s not currently a good way to have images for a plugin
Spencer Norman
@spencern
Feb 17 2017 00:13
FWIW We put ours in an S3 bucket
Brent Hoover
@zenweasel
Feb 17 2017 00:13
You would want to place that stuff in /public/custom
^^ or that
Vigy
@vigyano
Feb 17 2017 00:16
I see, so if I put an image(logo.png) in /public/custom/plugin-name, then to access the images from less or css or html is "domain.com/custom/plugin-name/logo.png" ???
Brent Hoover
@zenweasel
Feb 17 2017 00:18
Yes, I believe so. I can’t remember if you need the public prefix or not
Vigy
@vigyano
Feb 17 2017 00:19
ok, yeah no public prefix needed.
I will start with that and probably move to s3 as @spencern suggested. But it would be great if we can consolidate all the plugin resources into /imports/plugin/custom itself
Brent Hoover
@zenweasel
Feb 17 2017 00:26
With the current Meteor limitation, it would probably require some sort of build step to move all plugin files to something within public
Spencer Norman
@spencern
Feb 17 2017 00:32
Have you guys ever noticed the router freezing up?
I can’t reliably reproduce it, but generally if I click around enough, especially if the template is loading I can get it to freeze to a point where the url changes and autorun blocks run, but the template never changes
Vigy
@vigyano
Feb 17 2017 00:43
@zenweasel - if we put the images in /public/custom then the whole reaction repository has to be maintained privately to keep track of image changes? is there any other way? also public/custom/* is ignored in gitignore, should I remove that and maintain reaction repo privately? it doesn't seems right.
Brent Hoover
@zenweasel
Feb 17 2017 00:43
that directory is ignored so you can place stuff there and update reaction separately
You can symlink that directory to the one in your plugin folder as a workaround
and just maintain your plugin in a repo
Vigy
@vigyano
Feb 17 2017 00:48
how do i symlink to a public folder in plugin?
Brent Hoover
@zenweasel
Feb 17 2017 00:48
you would place the symlink in public/custom/ to your plugins images folder
Vigy
@vigyano
Feb 17 2017 00:50
I mean how to symlink in meteor in windows?
Brent Hoover
@zenweasel
Feb 17 2017 00:50
Oh, I don’t know how to do a symlink in Windows
You use mklink apparently
Vigy
@vigyano
Feb 17 2017 00:53
I see, thanks. I am still wondering how to manage this when I deploy to galaxy or other platforms? do i need to write a script?
like pre-build script to create this symlink?
Brent Hoover
@zenweasel
Feb 17 2017 00:54
Yeah, that’s a good question. That’s one way at least. It would depend a lot on how you are deploying
Vigy
@vigyano
Feb 17 2017 00:57
for example, if I just deploy to galaxy "meteor deploy ..."? how do we add prebuild script
or heroku, the same issue exists to add symlink in those platforms
Brent Hoover
@zenweasel
Feb 17 2017 00:59
I don’t know anything about how Galaxy works. You could just create a script to copy the files from your plugin to the public directory before you run meteor deploy
Just a wrapper around that that does any utility stuff you need. Assuming meteor deploy pulls all files from your loca file system
Vigy
@vigyano
Feb 17 2017 01:05
I see, so I need to run the prebuild script before I run meteor deploy. It won't work for heroku since the files needs to be committed to branch before heroku deploy.
it might work for galaxy since it uses local files I guess.
Brent Hoover
@zenweasel
Feb 17 2017 01:06
You would sort of run into that with just managing your local plugin with Heroku unless you use git submodules or something
Philip Hultgren
@Journey316
Feb 17 2017 03:58
Hi! I'm not sure how this works, but does Reaction handle any concept of CMS?
For example, within the dashboard can I add content (static html) as you might expect something like wordpress would do?
Dominik
@domi-nik-
Feb 17 2017 09:17
@Journey316 AFAIK it is not implemented at the moment. But it is on the todo list.
Perhaps this could help you in the meanwhile: https://blog.meteor.com/meteor-headless-cms-blog-tutorial-558c85e9b08d
Brent Hoover
@zenweasel
Feb 17 2017 09:37
We do have big plans for Content and integration with other CMS systems, but we don’t have anything right now
Vigy
@vigyano
Feb 17 2017 09:59

I am trying to override navbar color in plugin by overriding as below in less file inside plugin but its not working.

@import "{}/imports/plugins/included/default-theme/client/styles/main.less";
@navbar-default-color:             #a10f2b;
@navbar-default-bg:                #a10f2b;

any idea?

Brent Hoover
@zenweasel
Feb 17 2017 10:00
Did you look at the example-theme repo?
I am trying to convert existing website which has custom navbar styles to reaction but due to load order i guess the reaction navbar style always overrides everything. So, trying to go with overriding thru variable, but not working
do i need to reaction reset?
Brent Hoover
@zenweasel
Feb 17 2017 10:09
No, you shouldn’t
I know the code in the example-theme can override the navbar styles so I don’t know why that wouldn’t work
bnordvik
@bnordvik
Feb 17 2017 14:04
I loaded 5000 products into the Mongo DB using the method Meteor.call("products/createProduct", product); Using a for loop append the number of the loop to the title: Product + i. The product object is {"type": "simple", "Product" + i} Everything loaded just fine. Now when I try to access the home page the page becomes unresponsive to loading?
bnordvik
@bnordvik
Feb 17 2017 14:09
I was able to sign out as admin. Then only the basic example product shows on page?
prosf
@prosf
Feb 17 2017 14:23

I am working on the issue with the incorrect products' urls in the cart drawer,
(reactioncommerce/reaction#1586)

and plan to have a working solution today, and hopefully a pr for Reaction.
The problem seems that a subscription to get the cart's products doesn't exist
So the minimongo's products doesn't contain the required docs.
The only time the url is correct, is because the products col is filled by some other
procedure, e.g for showing products in the homepage or in pdp.

So my approach is to add an extra filter"productIds" in products publication in order to be able to get products with specific ids.
So the cartDrawer can subscribe to it supplying it with the items' ids.

Another approach is to simply add a product subscription(not products) to cartItems.js like
Template.CartDrawerItems.onCreated(function () {
this.subscribe("Product", productId);
});
This is less invasive but requires more calls(as many as the cart items)

A third one I can think(but maybe not too clean) is to make Cart publication, to return products collection as well (only the products
it contains)

So what do you think? Should I stick with the first approach?

bnordvik
@bnordvik
Feb 17 2017 14:56
It looks like if an optional product is sent to the "products/createProduct" call, the variant is not created. Is there any reason for this? I just want to be able to give the product titles so I can check the searching on the titles?
Vigy
@vigyano
Feb 17 2017 19:41
@zenweasel : is there any way I can override entire navbar through a single css file? I am trying to migrate existing site into reaction but the existing navbar css styles are getting overridden by reaction navbar styles. Instead of overriding through variable, is there anyother way to use the existing navbar css style files?
Vigy
@vigyano
Feb 17 2017 20:38
@zenweasel : Never mind, the variable override works
thanks for the help