Typeset2

Typeset2 is a simple open-source content management system that can be added to most any bare-bones PHP website. It's ideal for small custom hand-made sites that need to allow the client to update small bits of content themselves.

Try editing this page now

(Don't worry about messing anything up. This page resets every 10 minutes.)
View on GitHub → ↓ ↓ ↓

Features

Installation

  1. Upload just the html/edit folder to the root level of the website.
  2. Create a new MySQL database by importing the database_template.sql file.
  3. Open "edit/_settings.php" and change the settings appropriately.
  4. Insert <? include "/edit/include.php" ?> at the top of any pages that should display managed content.
  5. Insert the appropriate "widget" in the pages where necessary (widgets are explained below).
  6. Edit your content with the admin area is accessible via yourwebsite.com/edit

Widgets

Blogs

Sequencial posts with dates, titles, an image, and a body of text, best for things like news articles, press releases, blogs, events, or any kind of content that needs to be organized by date.

Posts given a date in the future will be saved for later and published on that date, so posts can be created in advanced and automatically published at a specific date.

<? $typeset->blog(array(
	# Required
	"tag" => "example_blog", 	# A unique name given to the content
	"page" => "post.php?topic=", 	# Link to full article
	# Optional
	"title" => "My Blog", 		# Adds heading to the top of content
	"id" => "my-blog", 		# Adds id selector to content
	"items" => 10, 			# Limits the number of items returned
	"scope" => "past", 		# past/future/all
	"sort" => "date", 		# date/id/title/tag - Property to sort by
	"order" => "desc", 		# desc/asc
	"skip" => 0, 			# Skip a designated number of items
	"image_width" => 1000, 		# Max image width
	"image_height" => 1000, 	# Max image height
	"thumb_width" => 200,		# Max thumbnail width
	"thumb_height" => 200,		# Max thumbnail height
	"truncate" => 0, 		# Truncates the posts to short blurbs of x characters
	"format" => "html", 		# html/json/raw
	"template" => "template_file"	# Override the default HTML template with your own template file
)) ?>

My Blog

  • Test Blog Post

    Test Blog Post

    Jul 28, 2015

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • Blog Post Title

    Jul 28, 2015

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • Test

    Jul 27, 2015

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • Blog Post Goes Here

    Jul 23, 2015

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Banners

Banners are similar to blogs, but don't have a concept of dates. They're best for things like banners (obviously), ads, rotating image sliders, or any other group of image and/or text content.

<? $typeset->banner(array(
	# Required
	"tag" => "example_banners",	# A unique name given to the content
	# Optional
	"title" => "Banners",		# Adds heading to the top of content
	"id" => "my-banners",		# Adds id selector to content
	"items" => 50,			# Limits the number of items returned
	"sort" => "id",			# id/title/tag - date/id/title/tag - Property to sort by
	"order" => "desc",		# desc/asc
	"image_width" => 1000, 		# Max image width
	"image_height" => 1000, 	# Max image height
	"format" => "html",		# html/json/raw
	"template" => "template_file"	# Override the default HTML template with your own template file
)) ?>

Blurbs

A blurb is a bit of image/text content that doesn't appear in a group or sequence, ideal for things like an "about us" section or any bit of text.

<? $typeset->blurb(array(
	# Required
	"tag" => "example_blurb",	# A unique name given to the content
	# Optional
	"id" => "about-me",		# Adds id selector to content
	"image_width" => 1000,		# Max image width
	"image_height" => 1000,		# Max image height
	"format" => "html",		# html/json/raw
	"template" => "template_file"	# Override the default HTML template with your own template file
)) ?>
About Us

About Us

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

HTML

Just HTML, great for things like 3rd-party embed codes, videos, or anything else not covered by the other widgets.

<? $typeset->html(array(
	# Required
	"tag" => "example_html",	# A unique name given to the content
	# Optional
	"id" => "html-widget",		# Adds id selector to content
	"format" => "html" 		# html/json/raw
)) ?>

Any HTML will work. This is great for widgets, badges, embedded video etc.

Other Stuff

  • Content templates are in the/edit/templates folder. Each content type has a minimal default template, but that can be overridden by creating a new template file and passing the "template" option to the class, pointing to your new file.
  • The title of a blog post can be grabbed with <?= $typeset->post_title() ?>, which is useful for things like <title> meta tags.