O'Reilly logo

CMS Made Simple Development Cookbook by Samuel Goldstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying the number of pages in the CMS using a User-Defined Tag

Virtually, all of the content that CMS Made Simple displays or uses to display pages is stored in a database; therefore, it's not at all unexpected that you might want to access the database from a User-Defined Tag. Fortunately, this is not a difficult thing to do.

This recipe shows you how to get a reference to the database abstraction layer and how to issue and process a query from within your User-Defined Tag.

Getting ready

For this recipe, you will need access to your site's Administration area with permission to "Modify User-Defined Tags" and "Modify Templates". It assumes that you are using the default NCleanBlue template, but will work for any template.

How to do it...

  1. Log ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required