|
4d378c14b2981725cde43690e6d90e78
|
A different linklist for each page or collectionby Pfaff - Member - 10:47AM, Jun 27, 2008 |
|
I know the subject of linklists has been beat to death. I have searched and didn’t find my answer or maybe I did and didn’t understand it. If I have a page called Home Store (pages/home-store) and I want a specific linklist to show up on that page, how would I achieve that? Also, if I have a collection called “Sale” (collections/sale) and want to use a specific linklist for that, how would I achieve that? I have linklists made and I understand how to build them. Common sense is telling me that I need to make a conditional statement in page.liquid and also in collection.liquid. If this has been discussed, a link to the thread would be greatly appreciated. Thank you so much. Last edited 10:49AM, Jun 27, 2008 |
|
|
I don’t think this exact question has been asked. Your conditional is more elegantly placed in theme.liquid, where your navigation is, not in the other templates. I’ve written this up as a general code, so that other people can use it too. So: this is code for one special page and one special collection. The only thing you have to customize, if anything, is in the first five lines: the titles of the relevant special page, collection and linklists. @Pfaff: for you it should work straight out of the box, if you just make one linklist called ‘homestore’, and another called ‘sale’. Case-sensitive.
— Last edited 12:39PM, Jun 27, 2008 |
|
|
This worked out perfectly and actually made more sense than I thought it would. Now my next question (don’t kill me). How would one perform the actions for multiple collections and/or pages? So far this has answered a lot of questions for me and I can’t thank you enough.
|
|
|
ha! thought this would follow… two options: if it’s just a few special collections and pages, you can just expand the code above, by doing specialpage1, specialpagelinks1, 2, 3, and so on, and inserting if..elsif…elsif…endif statements for each title. otherwise, here’s a totally different and nifty approach, if i may say so: customlinks:1 – make a new linklist. call it’customlinks’ 2 – list the title of each collection or page for which you want special linklists. create a link for each. then point each to “web address” (yes yes!) and a name that you want to give to your new link list. So the linklist “customlinks” now contains the following links: About Us → http://aboutusSale → http://saleHome Store → http://homestoreGot it? [minor caveat: the linklist management is slightly buggy. sometimes you have to delete a whole linklist and start over, because you’re not given a naming option – so do this step carefully; it’s better not to make mistakes] 3. Ok, now make your custom linklists. I’ve attached a prefix to each, so as to have them all appear close to each other on the admin, for easier management. I’ve named the prefix “custom” and separated with a hyphen, but if you like you can change that. So for the above example, you’ll have the following linklists: custom-aboutuscustom-salecustom-homestoreAnd the links that those lists contain will be the ones that appear on your special pages. Plug ‘n play:
|
|
|
Well it all worked out perfectly and your directions and code were very precise. Thank you so much for all of your help! My last and final question is how would I omit the main menu linklist from the index page?
|
|
|
you’re very welcome! to leave the main menu out of your index, the following should work:
|
|
|
it just occurred to me after posting this that you maybe meant to have a custom linklist for the index page too, not just to do away with navigation altogether, which is what the above code does. if you want to customize your index linklist, just replace the line
by:
and then in your “customlinks” linklist, add a new link called “Welcome”, since this is what the page_title is for the index template. Point this to http://welcome or http://home, or whatever you please. If you change the page_title of your index page, as many people do, just make sure to rename your “Welcome” link to whatever the new title is.
|
|
|
Thank you, Christina! That was helpful to me as well. ---
Lisa, CreativeGoddess
|
|
|
Hi there! I’m new to Shopify and this system and I have been trying to add your code to my page. I think I need the same thing – a page that will display multiple links to Smart Collections that will contain products listed by Manufacturer. I have created the Link list and page, but when I add the code I either get the main navigation bar links repeated, or a page with the Manufacturer names on the Navigation bar. I’m clearly adding the code in the wrong place in my Index.Liquid page – could you steer me in the right direction to get this to work please? I hope I have explained the problem clearly and many thanks in advance for your help. Best regards Martin Blitz Audio
|
|
|
put it in theme.liquid, not index. you have to replace your navigation code with this one, otherwise you’ll have a duplication. your navigation code will probably start with the words Good idea to keep a backup of the original theme.liquid somewhere before you do this. — Last edited 09:13PM, Jul 08, 2008 |
|
|
Hi Christina Thanks very much for your answer and help. I was adding this to the theme.liquid page – sorry for my confusion on that. I tried adding the code as you described but the result is that I get the links in my Links List appearing on the main links bar – I want them to appear on the page itself so that someone viewing the page can click on a Manufacturers name and then be shown all the products by that Manufacturer. I may be misunderstanding the expected behaviour from you code but as it is, this would not work for me. With around 50 manufacturers to add to the site, my navigation bar would fill most of the page and look wrong. I need the links to appear in the body of the page “Manufacturers” that I have created. Here is the code as it looks right now – maybe I am still adding it in the wrong place?
The desired end result for me would be to display a link on the main menu links bar (Manufacturers) and clicking that link would display a page with the manufactures names. Clicking on that name (a link) would then display all of the products by that manufacturer. Many thanks again for you help with this. I really like Shopify and if I can get this to work as desired, I will be online quite quickly I think. Talk to you soon. Martin Blitz Audio
|
|
|
hi Martin, the code is designed to replace the standard link list with other menu items for certain specified pages. what you need is clearly different, & will require a different form of customization. it’s entirely possible, but unfortunately, i don’t have time to help out right now – my day job is keeping me busy. good luck.
|
|
|
Hey Christina I was coming to that conclusion! It’s useful to be able to add items to the main menu – it may well be used in my site, but for now I guess I will have to try a different solution or find a developer! If you have time to tell me if it’s possible to add a link to a page and have that point to a Custom Collection, then that would get me out of a fix! Many thanks for your help anyway. Best regards Martin Blitz Audio
|
Christina
Miss Manners
12:30PM, Jun 27, 2008