Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Thumbnail Grid Layout change

Thumbnail Grid Layout change

Scheduled Pinned Locked Moved General Discussion
4 Posts 3 Posters 861 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X
    X
    XLD
    wrote on last edited by
    #1

    Hi,

    currently I’m using the thumbnail grid with 1 thumbnail per column.

    Now I would like to add an option to my page layout, that changes the Thumbnail Grid „Layout Type“.

    Like a „view all projects at a glance / Index“ button.

    Example:

    In default mode it would be

    „Top aligned“
    1 Column
    1% Column Gutter
    8% Row Gutter

    After the „Click“ it would be

    „Masonry“
    4 Columns
    1% Column Gutter
    8% Row Gutter

    Is this possible?

    Best,
    A

    Bildschirmfoto 2021-06-26 um 11.52.20.png

    E 1 Reply Last reply
    1
    • X XLD

      Hi,

      currently I’m using the thumbnail grid with 1 thumbnail per column.

      Now I would like to add an option to my page layout, that changes the Thumbnail Grid „Layout Type“.

      Like a „view all projects at a glance / Index“ button.

      Example:

      In default mode it would be

      „Top aligned“
      1 Column
      1% Column Gutter
      8% Row Gutter

      After the „Click“ it would be

      „Masonry“
      4 Columns
      1% Column Gutter
      8% Row Gutter

      Is this possible?

      Best,
      A

      Bildschirmfoto 2021-06-26 um 11.52.20.png

      E
      E
      ErEs
      wrote on last edited by
      #2

      @XLD hey, great idea. all the information for the thumbnail grid is stored in the data-config attribute. changig its values leads to a different appearance on your website.

      in this example i changed the desktop columns to be 8 and then attach this value back into the data-config attribute. in your case this would be 4 columns for layout two.

       // Get the thumbnail grid
        const thumbnail = document.querySelector('.thumbs-collection-region');
      
        // Get the current value of the data-config attribute
        const dataConfig = JSON.parse(thumbnail.getAttribute('data-config'));
      
        // Update the colCount property of the desktop object
        dataConfig.desktop.colCount = 8;
      
        // Convert the updated object back to a JSON string
        const newDataConfig = JSON.stringify(dataConfig);
      
        // Set the updated value of the data-config attribute
        thumbnail.setAttribute('data-config', newDataConfig);
      

      there is one thing however, i could not figure out either. if i wrap this code in a click event ( e. g. if i click on a button ), the code gets updated correctly but on the page itself nothing changes. i guess i am missing something here for updating the css?

      maybe someone will read this old post and come up with an idea.

      1 Reply Last reply
      0
      • arminunruhA
        arminunruhA
        arminunruh
        Global Moderator
        wrote on last edited by
        #3

        changig its values leads to a different appearance on your website.

        ah i didnt know :)

        try this after u have changed the data-config value:

        jQuery(window).trigger('window_width_changed');
        
        1 Reply Last reply
        0
        • arminunruhA
          arminunruhA
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          and its probably easiest to just create a new page with some other thumbnailgrid

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          Online Users
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
          laytheme.com
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Search