How can I create my own custom pages and access them via URL

How can I create my own custom pages and access them via URL

AzeemHaider
Shopify Partner
13 0 1

I'm trying to create a theme for shopify. I'm new in theme development. 

 

I want to know how can I add my custom page in shopify theme liquid.

 

What I'm trying is.

 

1- Create file (custom-brand.liquid) in template folder.

2- access it via URL https://localhost:3000/custom-brand <===== Error: 404

 

How can I create my own custom page while developing theme.

Replies 11 (11)

Ninthony
Shopify Partner
2343 354 1039
I'm not sure I understand. There is no way to truly develop locally on shopify, you'll always need an internet connection. You can use Theme Kit to develop on your machine and watch your files, so you can work in your favorite editor. To work on adding a new feature that you want to test for a bit before you make it live, you can duplicate your theme and make your changes on the duplicate, then when you are ready to push the changes live you can just publish that theme.
If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish 😄
AzeemHaider
Shopify Partner
13 0 1

Sorry to say but you not understanding my question. It's not about local development or remote one it's about creating a custom page and how we can find URL of this page.

 

I'm using Shopify Slate for theme development. 

 

I want to create a page for my brands (e.g custom-brands)

 

What I'm trying to achieve this is.

1 - I'm creating new file (custom-brands.liquid) under template folder

2- Try to access this file from my shop URL (e.g shop-name.myshopify.com/custom-brands) 

But this one is responding back an Error 404 (which mean my site is not able to locate this page)

 

I want to ask how can I create custom pages and access it via URL.

 

How can I create my own custom page while developing theme.

PaulNewton
Shopify Partner
7129 632 1487

Shopify has predefined url endpoints, 

There is no url(/custom-brands) , or content created because you make a theme file currently.

Currently if you make custom-brand.liquid that has to be a  snippet,section,asset,or layout that is used as part of a template for content.

Or an alternate template.

 

  • To create a page '/page/custom-brands' use the shopify.com/admin/pages.
  • Pages default to using the page.liquid template by default.
  • In page.liquid you can include /snippets/custom-brand.liquid using {% include 'custom-brand' %} with a conditional matching the page handle
  • OR change custom-brand.liquid to be an alternate template :
    • /templates/page.custom-brand.liquid
    • then in the shopify.com/admin/pages find the page you want and assign the alternate template
    • or force the alternate template by using the view parameter ?view=custom-brand

At this point I recommend you start at the beginning with shopifys theme documentation to remove assumptions about it's systems.

https://help.shopify.com/en/themes/development.

 

Then to have the url  /custom-brands it will have to be a redirect that still points to another EXISTING piece of content.

https://help.shopify.com/en/manual/sell-online/online-store/menus-and-links/url-redirect

Contact [email protected] for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


hauvq
Tourist
7 0 1

Do you solve this problems. I've same issue as well.


@AzeemHaider wrote:

Sorry to say but you not understanding my question. It's not about local development or remote one it's about creating a custom page and how we can find URL of this page.

 

I'm using Shopify Slate for theme development. 

 

I want to create a page for my brands (e.g custom-brands)

 

What I'm trying to achieve this is.

1 - I'm creating new file (custom-brands.liquid) under template folder

2- Try to access this file from my shop URL (e.g shop-name.myshopify.com/custom-brands) 

But this one is responding back an Error 404 (which mean my site is not able to locate this page)

 

I want to ask how can I create custom pages and access it via URL.

 

How can I create my own custom page while developing theme.




icemancml
Visitor
1 0 0

Did you figured out? I want to create for example the About page and other pages like you and just use shopifyurl/pagename. 

hauvq
Tourist
7 0 1

Do you have any solution for this problem ?


@icemancml wrote:

Did you figured out? I want to create for example the About page and other pages like you and just use shopifyurl/pagename. 


 

hardik355
Shopify Partner
240 22 36

Hello

It's easy to create page with url. please follow steps.

1.  In theme template create new file like page.your-file-name.liquid
2. After admin pages section create page. 

3. And after Theme template in right sidebar dropdown show your file which you created in template section.

4. Select your file and save.

5. Header you can check your URL.

filesave.png


Thanks. 

If helpful then please Like and Accept Solution.
For App Development and Design changes Hire Me.
Skype: live:hardikradadiya355
Thanks
Xin_Wang
Tourist
4 0 1

Hi @hardik355 

The ideal url the Arthur would like to be `domain/customize-brand`, instead of `domain/pages/customize-brand`

Any solution on that?

Thanks

hardik355
Shopify Partner
240 22 36

hi @Xin_Wang 

I think this url generate shopify default. so i think it's not possible.


If helpful then please Like and Accept Solution.
For App Development and Design changes Hire Me.
Skype: live:hardikradadiya355
Thanks
Brickwood
New Member
6 0 0

My search for this same question brought me to this blog post.

 

Here is the answer -

 

You want this  -  www.domainname.com/path

 

But you can only have this  -  www.domainname.com/pages/path

 

Go into the settings an set-up a 301 redirect.

 

/path  goes to  /pages/path

 

When someone says, "Find me at domainname.com/path"... and the listener types it in, it will automatically redirect to the /pages/path page.

 

 

ghayoor
Shopify Partner
1 0 0

 

Hi Xin,

Yes, it is possible. As you know, Shopify has predefined URLs like collections, pages, blogs, and products. However, if you want to create a custom route, you’ll need to bend some rules. I would suggest editing the 404 page: wrap all the 404 content within a div, then use JavaScript to dynamically update the content of this div. This way, you can add as many routes as you'd like.

Note: Use this method for specific cases, as it can cause SEO and performance issues.

For more details, feel free to contact me.🙂