As always, we need a new structure for our template. Make sure all these directories exist within each other:
blocks
,autonav
,templatesanddynamic_loadbuilding this path blocks\autonav\templates\dynamic_load
.Create a new file
view.php
with the well-known content:<?php $bvt = new BlockViewTemplate($b); $bvt->setBlockCustomTemplate(false); include($bvt->getTemplate()); ?>
All the magic happens in our JavaScript file
view.js
:$(document).ready(function() { $(".nav a").click(function() { var pageUrl = $(this).attr("href") + " #content > *"; $("#content").slideUp("normal",function() { $("#content").load(pageUrl,"", function() { $("#content").slideDown("normal"); }); }); return false; }); });
After you've created all the files, go back to your page and change the
Custom Template
of theautonav
block where you want to try the dynamic page loading.
concrete5 Beginner's Guide
concrete5 Beginner's Guide
Overview of this book
Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Installation
Working with concrete5
Permissions
Add-ons
Creating Your Own Theme
Customizing Block Layout
Advanced Navigation
Creating Your Own Add-on Block
Everything in a Package
Dashboard Extensions
Deployment and Configuration
Pop Quiz Answers
Index
Customer Reviews