How to create content types that are not list in Sanity Studio? - sanity

I know how to create a content type in Sanity Studio for lists. For example, blog posts, customers, orders, payments, etc.
But now I want to use a Sanity project to provide content data for my home page.
On my home page, I have a Hero section, that is not a list.
It contains a title, a description, and a CTA that has text and a link.
How can I define the schema of this section, in my Sanity Studio?

Related

How can I create a metafield with the type: product, for a shopify input?

I have made several metafields with the type as product, so I know they work, but in this section they don't show up for this link. I can hardcode the link to a specific product, but I want it to be dynamic using metafields. I'm using the palo alto theme.
and this is the result when I click the dynamic source button:
I'd rather leave any theme customization or coding as a last resort.
A link would take a metafield of type url but you are trying to add a metafield of type product. Type product stores the product object with all its data that's not what you need here if you just need to link to the product page.
Id just set up another metafield of type url and pop the url of the product in there.
I'm not familiar with where you are adding this in the Palo Alto theme but unless this is a section that appears on multiple pages, like product pages or blog pages, where you need to link to a different product on each page you may not need a metafield at all.

Orchard CMS Customer Module

My case is that we want to build a customizing Lab Module (show Basic Science Research) which provides a template to show each lab pages in consistent style. This module will also allow each lab's manager(non-developer) to update their own lab pages with some textbox, checkbox, upload file or image, TinyMce plain input elements(not html/css) after they login Orchard (or Developer directly provides them some links to update page infos without login, best not in Admin Dashboard). Each lab page will show Research, Project, Members, Publication, News Sections in front-end. My current plan is creating ResearchLab type (ResearchLabPart/ResearchLabRecord includes lab title, research_topic, research_image, research_protocol etc), Project type (ProjectPart/ProjectRecord includes title, start_date, foreign key researchLab_Id etc), Member type(MemberPart/MemberRecord include name, title, Linkedin links, foreign key researchLab_Id etc), Publication Type(Member/MemberRecord include name, title, Linkedin links, foreign key researchLab_Id and project_Id etc) etc. The foreign key is that once a researchlab id is chosen and based on this value, corresponding project, publication and news for specific lab could be queried as well right away. When lab manager updates the Researchlab part page, he/she wants to upload some research_image or protocol pdf, doc files. For ResearchLabPart (having lab_title, research_topic, research_image, research_protocol properties etc) and I could easily attach ImageField (assuming name ResearchLabImage) as OfType("MediaPickerField") or fileField(some external module) into ResearchLabPart in Migration.cs after enabling these two external modules. In the ResearchLabController of my custom module, Edit Action will view link to a return model=_contentManager.BuildEditor(ResearchLab) which will go to EditorTemplates--Parts--ResearchLab.cshtml. I want to assign the url (or file/image's name values, using ((dynamic)Model.ContentItem).ResearchLab.ResearchLabImage ) into research_image, research_protocol properties of ResearchLabPart. It looks like I need to implement assigning values in Eitor method of LabMemberDriver, not sure? My target is to let file or image fields to save files and images in some folders under my module directory and save the files or images's name or url path into photo, cv properties of LabMemberPart. Am I going to right direction? How to connect and exchange image/file fields to the properties of ResearchLab part in source code part? Any thoughts or comments are welcome. Thanks.

How do you generate a URL with custom variables on each product page?

I need to generate a URL link on each product page. Each URL needs to contain custom variables specific to that product.
Like so : www.example.com/{{keywords}}/{{productID}}
My understanding is that any custom variables must be saved as metaTags.
My logic to generate the URL is as follows
Create an Embedded App.
Display a dropdown list containing all products.
Display input fields for the user to populate with the text for "keywords" and "productID"
Save this information as Meta Tags so it can be accessible within the Liquid templeting.
Example Mockup of Embedded App : https://imgur.com/D9Grv4m
Example Mockup of Generated URL: https://imgur.com/yjUb9JU
How do I solve the following issues?
How do i save "keywords" and "productID" variables for each individual product.
How do I generate a URL with these variables and populate them on each product page?(I can do it manually through editing the theme but there has to be a way to do this programmatically)
You cannot generate an URL like:
www.example.com/{{keywords}}/{{productID}}
With Shopify you instead use
www.example.com/products/product-handle
And on that product page, you can do as you please with the product ID, and any metafields you choose to maintain and create.

Shopify: Show multiple collections on one page

In the image below, you can see I've managed to make a drop down menu in a Shopify store. The drop down menu contains some collections. My question is: when user clicks on "Men's" s/he's directed to a certain collection (right now: Walk shorts).
Is it possible that when user clicks on "Men's", s/he's presented with all the collections that you see in that drop down menu?
You can do this using tags.
Have all you product in those collection tagged with the tag "men", then simply have the top link to /collections/all/men
http://docs.shopify.com/manual/your-store/products/edit-tags
Charles is right, you can do this with tags.
I suggest taking a look at this article in the Shopify docs:
Creating subcategories of products. It explains how to create subcategories with tags and gives a few examples of how to display them on one page.

Different Variants per product: Shopify

I have started to create my eCommerce website and I have run into a road block. I have used a Shopify tutorial to create extra variants (excluding the variant options built in) to allow extra options (http://wiki.shopify.com/Line_Item_Properties). Shopify calls them line item properties. The problem I am running into is, this line property shows up for every product I add. Each product should have its one class of line properties.
Example:
Collection 'A' comes with choices 1, 2, and 3
Collection 'B' does not come with choices (but line property still shows on page)
Collection 'C' comes with choice 5, 6, and 7
Has anyone modified the products.liquid theme to allow such dynamics?
I have attached an image that represents my question. The image above is correct for the assigned product in the assigned collection. The image below should not have the line properties that are added in the product theme page. Is it possible to apply these line properties per product?
The red circle = error
What you'll need to do is create alternate product templates for the different types of products you want to display. See the section on product template variations in the Line Item Properties article on the Shopify wiki:
It’s unlikely that every product of your shop needs to collect the same data when added to the cart. For this reason Shopify supports template variants. To access this feature, head over to the Template Editor. In the sidebar click “Add a new template”. Select your product.liquid and choose a name such as “monogram”. This adds a second copy of the product.liquid to your store called product.monogram.liquid. In this file you can add the form that you wanted. Once created you can go to your product page and you will see a new option in the sidebar where you can select which template to use for the product you are looking at. This allows you to design a series of forms for various kinds of products and associate them later to the products that need them.
Other useful links:
Can I create and use an alternate template for pages, products, collections or blogs?
Alternate templates
template