Jump to content

Blog's Notification in a page, as wordpress widget!


Recommended Posts

You can take a look at one of my blog site profiles, e.g. Editorial, to see a working example you can adapt to your site. It's built on PW and the blog module @pwired linked. The "widgets" are pages with

  • a PW template (that doesn't prepend and append anything in the template's family settings) and PHP file generating the output for each widget
  • a page living under /widgets

To display widgets on a page, the blog-settings template for the page where the site's configuration is stored has a page reference field "blog_widgets" where one can assign and order the widgets to be shown.

In site/templates/blog_sidebar.php the settings page is retrieved and a small code snippet like this renders all selected widgets:

foreach($blogSettings->blog_widgets as $widget) {
        echo $widget->render();
}

 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...