Dynamic page script for blocs!

Hello everybody!

Im willing to share great news with you guys! I’ve finished working on a script which allows dynamic content loading in blocs! :partying_face: :partying_face: :partying_face:

All you need to do is to add this .js file to your project attachments and rename couple ID’s.
dynamicpage2.js.zip (1.2 KB)
Correction: you also need to add this .js file
modernizr.js.zip (3.5 KB)

First you need to set your global header bloc ID “head”
Then you need to set IDs of all your content blocs “bloc-1”, “bloc-2”, etc.
Then your footer ID must start with “bloc-…” as well
And finally find the nav list and give it a “nav” ID.

You also don’t need to set active class in your project settings. Script adds and removes active class by itself.

If you are interested in how it works ask here and I’ll try to explain.

P.S.
I’m a complete noob in javascript so you may experience some bugs. All suggestions and bug reports are gladly welcomed! :crazy_face:

1 Like

That is really cool!! I am going to follow this, as this might be very useful for a project that is coming…

1 Like

Here is the updated version of the script:
dynamicpage3.js.zip (892 Bytes)

Changes:

  1. Copy the path of the script you need and remove everything after .js
  2. Open the dynamicfolder3.js in your favourite text-editing software
  3. Find the line 42 and add the path you got from step 1.
  4. Repeat if necessary

Thats it for today. :blush:

p.s.
If anyone knows how to get <!-- Additional JS --> paths, post here so I would be able to add custom brics to the loader.

1 Like