Is there a way to create a project via Youtrack API with a non-standard template? - youtrack

I'm trying to create a new project with the Youtrack API. And now I want to create a project with a template that I've created by myself on Youtrack. The API have only "scrum" and "kanban" as possible template parameters. Is there a way to create a project with my own template?
I used this API Call from the Youtrack API documentation site: Add a New Project
Thank you for your help.

Try passing the name of your template as a parameter:
POST https://username.myjetbrains.com/youtrack/api/admin/projects?fields=name,shortName,id&template=<template_name>
{
"leader": {
"login": "root",
"id": "24-0"
},
"shortName": "MSP",
"name": "Project from REST",
"description": "Template Project"
}

Related

Shopify - Modify Page Template & Sections Reference For Custom Page

I am attempting to modify a specific route/template in my Shopify theme, however nothing from examples I have seen or the documentation seems to take.
Currently I have created a page in the Shopify Admin team which is auto assigned to the route /pages/team-page.
In my templates directory I have tried creating different variations as to assign it a custom section such as
team.json
team_page.json
page.team.json
page.team_page.json
And within those json files referenced to my sections directory liquid file custom.liquid with the following:
{
"sections": {
"custom": {
"type": "custom",
"settings": {}
},
"order": [ "custom" ]
}
But to no avail it always references back to the template index.json which renders main.liquid from sections.
Attempting to print out the page.handle returns team-page, while page.template_suffx seems to return nothing.

BigCommerce Stencil Custom Page template not appearing

In Page Builder I've added a page called About Us which has the url '/about-us/'
I've been following the instructions found here
https://developer.bigcommerce.com/stencil-docs/storefront-customization/custom-templates
in order to make a custom template for that page.
I made a file called about-us.html in templates/pages/custom/page with the contents:
<h1>About Us Page Test</h1>
My .stencil file looks like the following
{
"normalStoreUrl": "my url",
"accessToken": "my access token",
"port": "3003",
"customLayouts": {
"brand": {},
"category": {},
"page": {
"about-us.html": "/about-us/"
},
"product": {}
}
}
I've stopped and reran 'stencil start' but every time I visit localhost:3003/about-us/ it just shows the normal page instead of the custom template I build.
Is there something I'm missing? Is this an issue with using the page builder in combination with stencil?
I assume you haven't set the custom template for your page yet.
Go to Web Pages and edit your About Us page then look for the Template Layout File dropdown. Your custom template should appear there if it is setup correctly.
The issue was resolved when a full system reboot was performed. I'm not sure why stopping and restarting stencil did not resolve this.

How do I use an ACS Token?

I am building a react-native app that utilizes the Google Books API. The API provides a property known as "ACSTokenLink" which downloads an .acsm file, not an .epub. A simple Google Search tells me that this .acsm file is for content protection and can only be opened with Adobe Digital Editions.
Google completely dropped the ball, failing to mention any of this in their API contract:
https://developers.google.com/books/docs/v1/using
Google API forums are a ghost-town, so I'm asking here in an attempt to learn more about these files and their use.
So, if I am developing a react-native e-reader, am I completely barred from using such a file?
Looking at the accessInfo slice sample from Google Books API :
The accessInfo section is of particular interest in determining what features are available for an eBook.
"accessInfo": {
"country": "US",
"viewability": "PARTIAL",
"embeddable": true,
"publicDomain": false,
"textToSpeechPermission": "ALLOWED_FOR_ACCESSIBILITY",
"epub": {
"isAvailable": true,
"acsTokenLink": "https://books.google.com/books/download/The_Google_story-sample-epub.acsm?id=zyTCAlFPjgYC&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api"
},
"pdf": {
"isAvailable": false
},
"accessViewStatus": "SAMPLE"
}
The epub section will have an isAvailable property indicating if this type of ebook is available.
We can use acsTokenLink as the "download epub link" and can set up our conditional:
if( book.accessInfo.epub.isAvailable ) {
axios.get(acsTokenLink).then( responseData => /* store epub in app storage here */ )
}
Looking further: I have found Epub.js as one solution to display epub files with React Native. Additionally, here's an example repo.

Creating a shopify template with unique content blocks

I have an ecommerce site, and I'm trying to create a "Lookbook" template. I want my client to be able to create a new lookbook (just as a simple page with a template of "page.lookbook" or similar), then be able to go into the page admin and select and upload images, links, descriptions etc.
So far I have:
page.lookbook.liquid -> calls in the section, lookbook-template.liquid
lookbook-template.liquid has an HTML template
It also has this schema:
{% schema %}
{
"name": "Lookbook",
"blocks": [
{
"type": "Image",
"name": "Lookbook image",
"settings":[
{
"type": "image_picker",
"id": "img",
"label": "Image"
},
{
"type": "text",
"id": "description",
"label": "Description",
"default": "<p>You can write <em>html</em> in here!</p>"
}
]
}
]
}
{% endschema %}
This way, my client can use the simple admin tools to add a new image block. Very nice!
However, this method means that every single lookbook gets the SAME image data as whatever I apply to the lookbook-template.liquid, and this isn't ideal at all.
What am I doing wrong here, and what's the right solution? I want one template that the client choose to attach to a page, and then for each template to have a unique set of images, links and descriptions that the client creates.
Unfortunately, section won't work to get some different content for each page with lookbook.page template.
A solution would be to install (or create) an app to manage metafields attached to pages. Then you can use metafields in your template.
Metafields is a way to add some extra fields in database:
https://help.shopify.com/themes/liquid/objects/metafield

Shopify: How to make new products hidden by default?

I have a shopify site that is hooked up with Lightspeed via MerchantOS. I need new products added via MerchantOS to be hidden upon sync/creation. All help is appreciated.
The Shopify product creation via API allows you to define the product visiblity (published / hidden). You should dig into MerchantOS to make sure when doing a POST to create a product at your Shopify store, it has the following property:
"published": false
Create a new, but unpublished product:
POST /admin/products.json
{
"product": {
"title": "Burton Custom Freestlye 151",
"body_html": "<strong>Good snowboard!<\/strong>",
"vendor": "Burton",
"product_type": "Snowboard",
"published": false
}
}