Use MediaPicker outside Admin - file-upload

Crosspost: https://orchard.codeplex.com/discussions/455072
I'm using Orchard 1.6.1
I know we can implement a mediapicker for editor templates of our custom modules/parts as detailed in this post: http://www.locked.nl/using-the-mediapicker-in-your-own-orchard-module
However, I'm wondering if we can use the media picker in the front-end for custom pages/forms with our own controllers. I want users to be able to upload images and such. Can we use the MediaPicker? Or do we have to implement one ourselves and use Media Services?
Any piece of advise or information would be highly appreciated. Thanks!

The media library picker is not designed to be used on the front-end. You will have to build your own.

Related

Should I have views in a .NET Core API

At the company I work at we have a couple of different services
API (.NET Core)
Internal Frontend (React)
External Frontend for customers (React)
I was asked to create some views which will be converted to PDF's by an API, but I can't decide where to put them as they are not related to our Internal- or External-facing projects.
My first thought was to put them in our .NET Core API. However this has previously been a strict json-only API, so I have an itch that this is not the intended use.
So internet, my questions are as follows
Is it a big NO-NO to put Razor-views in our API?
Should I dedicate a microservice to this?
What is best practice?
Thanks in advance!
You're right, Razor views will be excess. I see two options:
Backend: Create an endpoint which will return a PDF file based on passed data. Of course you can expand data. This way is similar with Razor: you have a view model and render it to PDF file. An example of library: iTextSharp.LGPLv2.Core
Frontend: Convert HTML to PDF on client's side. Something like react-pdf
I prefer first option, because, first of all, there is already an option "Save as PDF" in browsers, so it will be some kind of duplication of functionality. And on the other hand back-end PDF generation seems more flexible (you can use all of your domain and you can create independent layout either) and you can organise some kind of file cache.

Shopify can we change and override core code?

We have got new work for e-commerce website which is built in Shopify framework.We have a custom requirement on this website.the client wants to change the functionality of search box section in the header.Since we have not more idea about Shopify framework but we have worked in Ruby on Rails (Shopify built in RoR language) language.So my question is can we override and edit Shopify core files?if not what is the solution to make custom work in Shopify?
As in my knowledge, Shopify is paid framework and his team is provide extension and plugin but can we edit and update in these plugins?
If anyone has an idea please share your thoughts so that we can proceed our work.
Many Thanks in advance.
You can not overwrite Shopify's Core framework. There is some customization that can be done through their script editor but it is only available for plus merchants.
https://help.shopify.com/manual/apps/apps-by-shopify/script-editor/shopify-scripts
What kind of functionality are they looking to change? Most likely you'll have to create an external application and use Shopify API's to do this or use a search app from the app store.
You can not overwrite Shopify's Code. There is some customization that can be done through their script editor.
highly restriction Admin Pages Like Dashboard, Product pages, order pages, etc...
Most likely you'll have to create an external application.

Is it possible to create simple frontend for use with Virtocommerce without writing liquid pages

I am evaluating Virtocommerce for a small startup company. We only have a few products and would like to make use of VC's user and payment modules instead of creating a website ourselves from scratch. We are familiar with asp.net mvc, angularjs and RestAPI. However, we would rather not learn and use the liquid theme engine if all possible.
So the question is, is it possible/a good idea to simply create a angularjs web app and call storefront's RestAPI? Please advice. Thanks.
Yes, of course, it is possible, you even can exclude VirtoCommerce.LiquidThemeEngine project from storefront solution and use ASP.NET razor views for the rendering SEO critical pages and use client SPA for another kind of presentation logic.
We have some clients who use this kind of storefront implementation (without Liquid themes) but unfortunately, I couldn't provide any of these examples because they aren't in a public access.
If you will have more questions you might ask them in our community chat gitter VirtoCommerce/vc-platform

Shopify App Necessary? Hard-code into Theme?

I have much experience developing for WordPress but this will be my first project developing for Shopify.
I will be customizing a 3rd-party Shopify Theme with custom functionality as per the client's website needs. I've been reading much documentation but I am still a bit confused about Shopify Apps...
My question is:
Do I need to build an App to extend the functionality of my theme, or can I just hard-code the new functionality directly into the theme? Is there any reason to develop an App for functionality that will only be used on my theme?
I thank you very much for your advice.
Do I need to build an App to extend the functionality of my theme, or can I just hard-code the new functionality directly into the theme?
Short answer: Yes. (Damn that mathematician's response!)
Is there any reason to develop an App for functionality that will only be used on my theme?
Longer answer: Sometimes, yes.
That wasn't very helpful
Longest answer: True. Let's break it down a little more, then.
Without knowing what you need to do, I can't offer a concrete yes-or-no answer to the question, "Should I build Feature X as an app?"
If you...
Need to add, modify or delete any objects that require admin privileges (including products, variants, collections, orders, etc.), or...
Need to listen for any of Shopify's webhooks, or...
Need to store data in an external database for any reason...
... you will need an app to have the permissions required to access and manipulate data at this level.
However, if you...
Can do everything you need with the existing Shopify objects, and...
Need few or no settings to control the desired behaviour...
... you would not need to create an app. Shopify themes have some powerful tricks & tools available to you, including:
The ability to create custom endpoints for any of the main types of objects to get the data you need;
Easily-edited settings_schema file to add arbitrary configuration variables to help control your mini-app;
Javascript endpoints to let you add, remove & edit products in the cart
Hopefully this quick breakdown helps you decide if you need to create an app or not. (And to anyone who does need to make a single-site app, remember that Shopify lets you create 'Private Apps' that don't have to go through the app store process to get widespread approval)
I thank you very much for your advice.
You're welcome! Hopefully it proves to be helpful. Good luck!

Shopify Theme and ScriptTags

I'm new to Shopify app development and am a little confused with regards to the difference between ScriptTags and the Embedded App SDK.
My understanding, which might be incorrect, is that ScriptTags are best used to add functionality to the store front and that the Embedded App SDK basically allows you to integrate the administration portion of an app in the site merchant admin section. Is this correct?
Furthermore, if my app was to display an interface (i.e. a dialog with some options) to users via a ScriptTag is there anyway to integrate it into the site theme? Or would I simply add my theming, either dynamically via JS (potentially allowing merchants to edit default settings via the admin) or by loading an external CSS file via the ScriptTag (or both, I guess)?
Regardless of which approach taken, there is always the possibility that the site CSS could interfere or negatively impact the app-generated content. Is it common / best practice to reset the CSS used in a custom interface?
I am not sure I have understood your question clearly.
But I think you are referring this.
https://help.shopify.com/api/reference/scripttag
1) You can't create a new page with the scripttag in Shopify.
2) You can't save any data with the scripttag within Shopify.
You can submit your customized form, but Shopify can't accept and process that form.
Because the scripttag represents javascript and the javascript is only for client side programming.
I hope this could help.