NSwagStudio Liquid templates - asp.net-core

How do you use liquid templates with NSwagStudio to change how files are generated?

OK, it seems there are some samples of liquid templates there:
https://github.com/RSuter/NSwag/tree/master/src/NSwag.CodeGeneration.CSharp/Templates
You can copy them and start editing them.
Then, you just need to point to your folder to use them to generate custom code.
There is a wiki:
https://github.com/RSuter/NSwag/wiki/Templates

Related

Shopify asset path in stylesheet?

How to reference the assets path in css?
Can I still use style.css.liquid?
Not sure how to create the link tag.
Tried various paths and using a .liquid extension to be able to use filters.
Here is the working demo with dawn theme.
I have create a file name test.css.liquid and add it theme.liquid using {{stylesheet_tag}}
After it I have upload a image and add it to div background using liquid code into test.css.liquid.
and it works well, here is the frontend snapshot.
I hope this helps you.

Customize Shopware 6 invoice PDF

I'll change the template of the invoice pdf template in shopware 6.
The template self seems to be stored in the database in the table "document".
The pdf is generated by php.
Anyone knows, how to get a complete own customized template ?
The configuration in the backend is not enough.
Thank you.
I wrote an example Theme some time ago, that is extending the basic template: https://github.com/mnaczenski/SwagDocumentTemplate
The core template is located here:https://github.com/shopware/platform/blob/trunk/src/Core/Framework/Resources/views/documents/base.html.twig
So you can overwrite the file in your own theme like described in the documentation by extending the twig file and placing it in the right folder: https://developer.shopware.com/docs/guides/plugins/themes/theme-base-guide
Extend in Twig: {% sw_extends '#Framework/documents/base.html.twig' %}
Folder structure: /src/Resources/views/documents/base.html.twig
Generated PDFs are stored in the database due to German law, they can't be changed after generation. But new generated PDFs are based on the template.
The easiest way to customize your invoice templates is to use the WYSIWYG Document Editor. You can either customize an existing document or create a completely new document. Using one of the predefined document templates provides a good starting point for you to apply your customizations. But you can also start with a blank page.
With the visual editor, you can easily add new elements and variables and see your changes in the live preview. This will save you a lot of time in comparison to going back and forth hundreds of times between making adjustments in your Twig Files and generating new PDFs for testing.
Here is a YouTube Video, which shows you how easy and fast you can edit all your documents: https://youtu.be/fGBMDmVMPvA
I am the developer, which created the WYSIWYG Document Editor Shopware 6 App. Feel free to ask me any questions about the App. I am happy to help you.

PrintInvoice global variable - BigCommerce

I have the following case:
I'm trying to edit the PrintInvoice.html after downloading it through WebDav. The template was previously edited by another developer, but using the Template Files directly in the Storefront back when the files were visible in the Storefront. When opening the HTML template, the wording that I need to change is inside the global variable %%GLOBAL_ProductsTable%% so I'm not sure how to reach the text content inside. Replacing the global variable with custom HTML is not desirable.
Any suggestions are appreciated!
As others have stated, these global variables are saved within BC's back-end database which you do not have access to.
A workaround my team and I have done to edit the contents of these global variables is to use JavaScript at the bottom of the document that changes the desired text after it is loaded. This seems to be the only way we could find to edit those values.
Global variables like this are provided by the BigCommerce app, it is how the product data is sent through your store to email and can't be modified. To change the product table's appearance, the existing variable would need to be removed and replaced with your custom code.

Keystone.JS render multiple template files

I use keystone.js together with handlebars as template engine. Until now I had one .hbs-file for each page. However, HTML-Code is growing over time and I would like to split the HTML into several files. Does keystone.js offer a simple way to render multiple template files?
I'd prefer not to use technologies like webpack just for that "simple" task.
You can use partials to break up your templates, so you can include one .hbs file in another file.
Add a new file in the templates/views/partials directory, for example myPartial.hbs, and then you can include it in another file like so:
{{> myPartial }}
KeystoneJS will handle registration of .hbs files in the templates/views/partials directory.
You can read more here:
http://handlebarsjs.com/partials.html
If you use the KeystoneJS generator to set up your project, you can see this in action where pagination.hbs is included in blog.hbs.

How to use Pingendo 4 with themes and templates

I'm using Pingendo V4 (not-beta).
I assume templates are partly completed pages that I can start with and modify, and that Themes are only selections of shapes, colors that I can use on my own pages. Is that correct?
Can I download a (I assume Bootstrap) theme or template, use it locally and then transfer the files to my web site? How is the download done and them integrated with Pingendo?
Thx.
Templates are completed pages that you can edit and customize to your liking. Themes are sets of customizations. Sometimes themes and templates are made for particular business types, for example pingendo has a app, resteraunt, and fasion templates complete with there coresponding themes. With Pingendo you can download your theme by doing the following: Go to the HTML tab, which gives you the HTML view of your page. Copy and paste that into your own index.html page. Secondly go to the sass view in Pingendo and copy and past it into a custom.sass file that you create. Keep in mind you will want to convert that sass to css, there are free tools that do this online. Depending on your webhost the method of putting them online will be different. Most of the time you will need to FTP your files on to the server, put your html into the main folder may be names something like public_html. Put your css into a folder in the main folder called css, make sure your link to the css in your index.html reflects the file path. Once you have it downloaded there is no need to reintegrate it into Pingendo, the only time you will need to go back there is if you need to make changes. Of course you could always hand code the changes as well.