Recent searches


No recent searches

James Newman's Avatar

James Newman

Joined Oct 24, 2023

·

Last activity Nov 01, 2023

Following

0

Followers

0

Total activity

5

Votes

0

Subscription

1

ACTIVITY OVERVIEW

Latest activity by James Newman

James Newman commented,

Community comment Q&A - Help center and community

Solved.

 

Here'es how just in case helps others:

 

Inside the {{#each section.sections}} loop on the section page, I've added another {{#if articles}} block that loops through section.sections' articles and displays them.

You can play with the style attribute in the element to change the styling, however note that the main layout of the page remains unchanged and won't look like the category page:

Snippet:

          {{#if articles}}

         

          {{/if}}

 

In Addition 

Rather than duplicating the or even editing the CSS, I've applied the classes for categories to the sections and reshuffled the HTML structure (using

instead of
  • on the sections loop):

     

     

    Complete Snippet for Section-Pages.hbs is as follows (to modify Copenhagen theme)



     
     

       

         
         

            {{#if section.sections}}
            {{#each section.sections}}
           

             


               
                  {{name}}


               

             


              {{#if articles}}
             

                  {{#each articles}}
                 

    •               {{#if promoted}}
                   
                    {{/if}}

                    {{title}}
                    {{#if internal}}
                   
                         

    •             {{/each}}
               

              {{/if}}
           

            {{/each}}
            {{/if}}
         

          {{pagination "section.sections"}}
          {{#if section.articles}}
         

              {{#each section.articles}}
             

    •           {{#if promoted}}
               
                 

    •         {{/each}}
           

          {{else}}
         
          {{t 'empty'}}
         

          {{/if}}
          {{pagination "section.articles"}}
       

     

      {{#if promoted_articles}}
     

       

    {{t 'promoted_articles'}}


       
     

      {{/if}}

     

    Thank you to  Ifra Saqlain , Nicole

    Hope this helps someone else.

  • View comment · Posted Nov 01, 2023 · James Newman

    0

    Followers

    0

    Votes

    0

    Comments


    James Newman commented,

    Community comment Q&A - Help center and community

    Thank you Ifra Saqlain for the code provided.

     

    I got it working with a slight amendment to the code in below Snippet (correct me if i made any mistake)

     

         


     {{#each sections}} 
             

               


                 
                    
                            {{#is id AAAAAA}}
                                 
                            {{/is}}
                    
                            {{#is id BBBBB}}
                                 
                            {{/is}}
                    
                             {{#is id CCCCC}}
                                 
                                {{/is}}
                                  
                            {{#is ../category.id 00000}}
                               
                                     {{/is}}
                              {{name}}
                                     {{#is ../category.id 00000}}
                               

                            {{/is}}
                     

                   

                
              {{#isnt ../category.id 00000}}
                 {{#if articles}}
                 

       

      Note:

      00000 -- Category ID

      AAAAA -- Section ID

      {{asset 'A-ico'}} -- Image name for section A block

      BBBBB -- Section ID

      {{asset 'B.png'}} --  Image name for second section block

      CCCCC -- Section ID

      {{asset 'C.png'}} --  Image name for second section block

       

      This now give me desired affect.

      Still a few issues to address (further assistance required).

       

      Problem 1:

      I now have 3 buttons and associated images but wish to reduce the width and have 3 items on same line (if possible)

       

       

      I cant seem to find the correct Style.css expression to reference the blocks that have just been created here.

       

      Problem 2

      For the Other Categories (not category ID 00000) i still see the following:

      Note i added Green Text in Screenshot!

      This is coming from the Original Code in the Copenhagen Theme .

      which now resides after the  #inst code provided above.

      {{#isnt ../category.id 000000}}

       

      i suspect that some of the code needs to be copied into section_page.hbs in order to have same look and feel in a Sub Section.

      An assumption from below:

       

      I can confirm that there is an article present - which is not showing up:

       

       

      greatly appreciate all your assistance.

      James

    View comment · Posted Oct 26, 2023 · James Newman

    0

    Followers

    0

    Votes

    0

    Comments


    James Newman commented,

    Community comment Q&A - Help center and community

    Thank you Terese.

    Not sure where to insert this code or if it will work.

    To add some clarity to my request i have managed to get some screenshots approved which may help

    Categories on Home Page are already in Blocks and have Images (i managed to sort out the assets and link etc)

    When i insert the Code from above (from Ifra Saqlain  on Sep 2021) into the category_page.hbs

     

    it works as intended but with consequences as i have non-linear tree structure (owing to a few of the Categories having different Product groups within (Sections).

    These follow 

    Category  > Section > Section > Articles

    As apposed to the majority which are

    Category > Section > Articles

     

    Examples below:

    For the Category 14119644860957

    As there are  2 additional Sections within this category I get the desired look and feel :

     

     

     

    But as removing a lot of Code with reference to the each_Section within the Tree structures etc

    ALL Categories now with Blocks

    See below Category 1411968073293

     

    Where as before it looked like this with promoted articles etc

     

    My request is if there is a way to apply the Block to Specific Categories and not all.

    Root Cause is wanting to keep majority of the Standard coding in the Copenhagen Theme.

     

    I hope to have clarified a little more for you all.

    View comment · Posted Oct 25, 2023 · James Newman

    0

    Followers

    0

    Votes

    0

    Comments


    James Newman commented,

    Community comment Q&A - Help center and community

    Ifra Saqlain

    Newbie here so firstly thank-you for all posts as i have come a long way already with your help.

    I have 9 Categories  (Products in my case)

    Each Category has 5 Sections which are all the same [FAQ, Product Info, Troubleshooting etc]

    If i use the Code above get block for all of the sections (as intended i know!)

    As one of my Categories has 2 variants I have had to create 2 new Sections. Then within Each of these Sections i place the same 5 Sections as mentioned above.

    Below is a graphical representation of what i see currently using the Copenhagen theme

    Example if of a Category Product of T Shirts.

    There are 2 variations Long and Short Sleeved

     

    I am looking to apply the Blocks and ultimate aim to place image in them as i managed to do for the Categories on the home page.

    To achieve this

     

    The above code applies to {{#each sections}}

    I only want to apply to specific Sections of my choosing (assume using the section ID)

    The Copenhagen Theme is working well for the rest so dont want wish to remove complete code lines which would destroy the current section view when no variations (Sub Sections if you will)

    I hope i explained myself well enough (unfortunately can not send you link to HD as not public or share screenshots)

    Fingers crossed you (or anyone else) can assist.

    Rgds James

     

     

     

     

    View comment · Posted Oct 24, 2023 · James Newman

    0

    Followers

    0

    Votes

    0

    Comments