How to link to a custom template in Shopify? - shopify

I'm trying to add a link to a button in Shopify, but I can't get it to work.
I created a new template file in Templates called "page.alternate.liquid"
Then I try to link to it from header using this:
LINK
The output doesn't add any link at all, just a regular text.

To view an alternate template, you have two options:
1) On the resource in question, choose the template that the resource should default to using the selector on the right-hand side.
(Note: this only shows if you have at least 1 appropriate alternate theme in the live theme, and will only list the alternate templates in the currently-live theme)
2) When linking to the resource, add view=<template-suffix> to the querystring of the link.
Example: To link to an alternate page template templates/page.inverted_colours.liquid, your link URL would be /pages/about-us?view=inverted_colours
In your case in the question, that would look something like LINK
This article on Shopify partners blog might help as well: https://www.shopify.ca/partners/blog/shopify-alternate-templates
Hope this helps!

Related

Using two different blog listing page templates for the two different blogs in our shop

Hi we have two blog types defined within our shop and they both use the same template right now.
Specifically I want to make changes to just one of the two blogs listing pages (the page where a summary and thumbnail of each blog article is shown).
How can I achieve this? Will this automatically happen if I name the templates to something specific a bit like how wordpress handles templating ?
What you need to do is:
in admin/themes click on the three dots and edit the code
in the left pane create a new template in the templates directory
select blog as template and give it a name, e.g. second_blog
this will create a new template file blog.second_blog.json
go back to admin: /admin/blogs
select the blog to which you want to assign the new template
on the bottom right in the theme template dropdown, select the template second_blog
In the theme editor select the new template and make the desired changes
You now have two blog templates which you can design individually
What you need to do is:
in admin/themes click on the three dots and edit the code
in the left pane create a new template in the templates directory
select blog as template and give it a name, e.g. second_blog
this will create a new template file blog.second_blog.json
go back to admin: /admin/blogs
select the blog to which you want to assign the new template
on the bottom right in the theme template dropdown, select the template second_blog
In the theme editor select the new template
and make the desired changes
You now have two blog templates which
you can design individually
The process is documented here.

How to access code of a specific page in shopify?

I am building a Shopify website https://fone-kase-plus.myshopify.com/.
For example, I want to modify code of this page only: https://fone-kase-plus.myshopify.com/pages/iphone-6 .
How is it possible to do it?
If you go in the admin, and to that page (from Online Store/Pages) on the right you will see "Theme Template" and a name. That's the template that is applied to that page.
That name is a file in your theme under templates with a name like page.your-template-name.liquid.
If you copy that file and create another one like page.another-template-name.liquid you can then apply that template only to the pages you want. Then you modify that template file to make a page as you like.

How can I add a custom page to Shopify without the /pages/ URL?

I want domain.com/custompage, but the built in functionality puts all pages inside a /pages/ directory so the URL comes out domain.com/pages/custompage which I don't want.
I found this answer from a Shopify Guru in 2016 that mentions potentially setting up a custom HTML template or using an app, which no longer exists.
Any clues on how to achieve this? I have limited experience with Shopify templates, but could figure it out if someone could point me in the right direction.
This blogger says it can't be done:
"Q: Can you create pages on the root? A: The answer to this is no –> all pages have either /pages/, /collections/ or /products/ in the URL."
However others have told me it is possible. Just not how to do it.
Create a section Name "test" // first a step
Create a page json Name "test" // The second step
After creating the page, JSON does a section test

RedMine: Link to Wiki of another project does not work

I have two projects in Redmine and both have their wikis.
Is it possible to link the wiki page of one project to the wiki page of another project?
I ended so far with using of http links:
"Redmine web site":http://www.redmine.org
But I want to use relative paths like this:
[[sandbox:some page]] displays a link to the page named 'Some page' of the Sandbox wiki
The Examples are taken form Redmines official wiki page:
http://www.redmine.org/projects/redmine/wiki/RedmineTextFormattingTextile
You can also define a custom link text for wiki links without having to resort to plain textile links:
[[your-project:your-wiki-page|Relative Path in Redmine]]
Using this syntax, you get the advantage of colored links depending on whether the target page exists or not and correct links on case you ever decide to move your Redmine server.
This and other syntax details are described on the help page you can access by clicking on the small question mark button above most text fields or on https://www.redmine.org/help/en/wiki_syntax_detailed.html.
I found the solution:
You can just direct from Redmines projects folder:
"Relative Path in Redmine":/projects/your-project/wiki/your-wiki-page

How to create MSDN like links in Sandcastle documentation website?

I've generated a website documentation of my project with Sandcastle. This website uses frames so when I click though sites my URL in browser does not change.
I would like to have URL changed in browser when I browse through website documentation generated with Sandcastle. Why? Because I would like to link to concrete subpages of documentation from other parts of my developer environment.
And further more I would like to have this links permanent. So when I generate once again documentation from new version of my project, links will not change so that I will not need to change all links to new.
Is this possible and how to acomplish this?
If you add the code below to the top of SplitScreen.js the browser will "inject" the TOC frame and focus on the content you linked directly to (using the trick Vitaly Shibaev showed).
if (window==top) {
window.location = "/?topic=" + (window.location.pathname.substring(1));
}
This code works it the documentation is placed at the root of your website - if you have it in a sub-folder you need to expand on "/?topic" and remove the sub-folder part from the pathname part.
With this change you can use the "direct links". I also expect people who find you via Google get a better experience (getting the content they searched for AND the TOC bar).
In order to create correct links to specific subpages of documentation you may use similar request: $DOCUMENTATION_ROOT$/Index.aspx?topic=html/$TOPIC_ID$.htm
E.g. http://www.ewoodruff.us/shfbdocs/Index.aspx?topic=html/8dcbb69b-7a1a-4049-8e6b-2bf344efbbc9.htm
instead of http://www.ewoodruff.us/shfbdocs/html/8dcbb69b-7a1a-4049-8e6b-2bf344efbbc9.htm
Vitaliy and mawtex have solved the 'how to link to documentation subpages' part of your question.
The "making links permanent so they do not change when regenerating documentation" part of your questions is solved automatically, since the html file names created are based on a hash of the topic name by default. I.e. If you do not change the part of your code that you are documenting, then it will use the same file name.
You can change the way that html file names are generated, but all given methods are based on the member name or a hash of the topic ID, so links shouldn't break if the code hasn't changed.
See Sandcastle Help File Builder's NamingMethod documentation for more info.