Currently working on a CMS system and got my template system working pretty well however as it is now, in the sidebars static divs are shown while wordpress has widgets with which the user can choose which divs ( widgets ) to show on what sidebar and where ( like: last post widget in right sidebar 2nd position, search widget right sidebar 1st position , etc. ). I was wondering how to do this?
Should I put all divs/widgets in one sidebar.php template file in an array variable and then have a database table containing the order of them to appear or something?
Like:
sidebar.php
$widgets['latest posts'] = "<div>some latest posts div widget</div>"; $widgets['search'] = "<div>some search div widget</div>";
And have a table in database with all widgets and for which template they are and on what position they should belong inside the layout? Not sure if that's the correct way to do it.
Any help would be much appreciated,
Thanks in advanced!
Cheers.


Sign In
Create Account


Back to top









