Jump to content
hansv

Scrolling sidebar

Recommended Posts

Ryan has opened my eyes with his skyscrapers2-demo.  Uikit is really a fantastic frontend-framework.  My question is about  scrolling uikit-side-nav and the pw-code to use for the content.

Is it possible to realize a scrolling nav-side-bar as the uikit-layout-example: https://getuikit.com/docs/layouts_documentation.html ?  The scrolling-bar should show the headers for example h3 en h2 of the body-part of the page When scrolling down the page, the headers in the sidebar, e.g. h3 h2, show where you are in the page.


Can anyone show me the way to the code to trigger e.g. the h3 and h2 headers?

Share this post


Link to post
Share on other sites

Moved topic to Dev Talk as it is not, strictly speaking,  a ProcessWire question.

Share this post


Link to post
Share on other sites

Thx Kongondo & fbg13 for your replies.  I think this is a pure PW-question, the integration of uikit is a side-issue. 

I can rephrase the question in different ways

  • how can I make an index of page-content?
  • how can I find all subtitles and paragraph titles in a page and show them together as a summary

Share this post


Link to post
Share on other sites

Don't quite understand what you mean.

Do you have a textarea (page-content) field that has multiple <h2>, <h3> tags and you want to have a navigation for them?

If i got it right please mention if this tags are always the same.

Share this post


Link to post
Share on other sites

Maybe it's better to visualize

In the body-field of a page there is content.   

1 Lorem with H3-tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim.

1.1 Lorem with H2-tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim.

1.2 Lorem with H2-tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim.

2 Lorem with H3-tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim.

3 Lorem with H3-tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit sapien, pulvinar sit amet mi nec, consequat rhoncus nunc. Cras est urna, finibus ut elementum elementum, tincidunt id enim.

 

In e.g. a sidebar (see below), the headers (h2, h3, may also h4) are generated, and when scrolling down the page-content (body-field),  you scroll down to the headers in the sidebar.   The tags are always, h2, h3 and h4

1 Lorem with H3-tag

1.1 Lorem with H3-tag    

1.2 Lorem with H3-tag    

2 Lorem with H3-tag

3 Lorem with H3-tag

I try to find a way to generate the headers of the page-body-field and show them in a side-bar-panel.  This is PW-related, the scrolling down part is for the front-end framework, e.g. Uikit.  

In the cheatsheet of PW  I find way's to refer to page-fields (title, summary, body, ..) but I try to find a way to recognize specific html-content (headers, h2 -> h4) within the body-field.

 

Share this post


Link to post
Share on other sites
1 hour ago, hansv said:

I try to find a way to generate the headers of the page-body-field and show them in a side-bar-panel.

I think the easiest way to do this is with Javascript/jQuery.

Not too hard to write a script for this from scratch (that's what I've done in the past) but Google reveals a nice looking plugin that does it all for you: http://renaysha.me/anchorific-js/

  • Like 4

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Peter Knight
      Hi guys
      I know some of you are UIKit fans like me. I built a site recently using UIKit 3 and I'm having some layout issues on IE 11 and largest breakpoints.
      You have to set quite a big resolution or have a large monitor to experience this as it only happens on largest breakpoints.
      The main column in the above URL is successfully centered in most browsers except IE11.
      On IE 11, it shifts to the right. Basically it's a DIV using the uk-width-expand selector and then I have a custom max width and a margin in there to centre the content horizontally.
      Here's a simple CodeKit and JSFiddle of the issue
      https://codepen.io/edenstudios/pen/qvWpGo
      https://jsfiddle.net/EdenSt/auekfgqt/8/
      Thanks
      P
       
       
    • By snobjorn
      I have been searching a while for pre-made UIkit 3 themes that I can download in some form and use. But I have not found much. I work with variables and compile most times, but sometimes I would prefer working with a "finished" theme as a starting point
      I have found the following resources:
      https://github.com/zzseba78/Kick-Off https://github.com/uikit/awesome-uikit Do anyone else know of UIkit 3 themes that you could list?
    • By AndZyk
      Gallery Claeys is a art gallery in Freiburg, Germany, with focus on exhibitions of female artists. Our agency designconcepts developed a website that features the latest exhibitions of the gallery as well as an archive of previous exhibitions. Every artist has its own page with an excerpt of their works and a vita of the artist.
      The website was build with help of the framework UIkit and Barba.js for smooth transitions between pages.
      www.galerie-claeys.de
       
      Features:
      Exhibitions Page transitions  
      Exhibitions
      On the homepage you can find a preview of upcoming or current exhibitions as well as an archive of previous exhibitions. Based on the date the exhibitions get automatically sorted in one of the three categories (preview, current or archive). Each category has its own deep-link with URL segment.
       
      Page transitions
      The smooth fading page transitions are made with Barba.js.
       
      Modules used:
      Front-End Page Editor Markup Sitemap XML ProCache Tracy Debugger Upgrades  
      Regards, Andreas
    • By AndZyk
      This is a website for the musical area of the protestant town church Pforzheim, Germany. Our agency designconcepts developed a website that provides informations about the choirs, ensembles and orchestras as well as dates for their rehearsals, services and concerts.
      The website was build with help of the framework UIkit.
      www.musik.stadtkirche-pforzheim.de
       
      Features:
      Events Download dates  
      Events

      The events for rehearsals, services and concerts were created in Microsoft Excel and then imported as pages from CSV. For better organization, events are cross-referenced with choirs, ensembles and orchestras. Services and concerts are displayed in a events list, but rehearsals are only displayed on the page of the choir, ensemble or orchestra, to make the events list more compact.
       
      Download dates

      It is possible to download every event date as ICS file, which will be generated on clicking the download button. You can then add this event easily to your calendar app and stay up-to-date.
       
      Modules used:
      Email Obfuscation (EMO) Front-End Page Editor Import Pages from CSV Markup Sitemap XML ProCache Tracy Debugger Upgrades Wire Mail SMTP  
      Regards, Andreas
       
    • By Noel Boss
      Admin Theme Boss
      A light and clear theme based on Uikit 3
      Features
      Four unique color options Beautifully redesigned login screens Modern typografy using Roboto Condensed Extended breadcrumb with edit links Extends AdminThemeUikit, so you can continue using all current and future AdminThemeUikit features Option to activate theme for all users   Updated and Releases
      There is a shiny new release page where you can subscribe to updates for new releases of AdminThemeBoss.   Color Variants:
      ProcessWire Blue


       
      Dark Black


       
      Vibrant Blue

       
      Happy Pink

      Requirements
      Requires a current ProcessWire version with AdminThemeUikit installed and activated.
      Installation
      Make sure AdminThemeUikit is activated Go to “Modules > Site > Add New“ Paste the Module Class Name “AdminThemeBoss“ into the field “Add Module From Directory“ Click “Download And Install“ On the overview, click “Download And Install“ again… On the following screen, click “Install Now“

      Manual Installation
      Make sure the above requirements are met Download the theme files from GitHub or the ProcessWire Modules Repository. Copy all of the files for this module into /site/modules/AdminThemeBoss/ Go to “Modules > Refresh” in your admin Click “Install“ on the “AdminThemeBoss“ Module
×
×
  • Create New...