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!
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!
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:
- on page load fade in effect added. More info here:
Cool fade in effect on page load - #3 by EffexorXR
If you don’t need it simply remove first 3 lines of code:
- Included brics are now loading with content. But you will need to add them manually to the script
To do so you will need to launch preview of your page and by right-clicking open inspect element thing
Here you will be able to find all your brics .js paths:
- Copy the path of the script you need and remove everything after .js
- Open the dynamicfolder3.js in your favourite text-editing software
- Find the line
42
and add the path you got from step 1.
- Repeat if necessary
Thats it for today.
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