diff --git a/docs/en_US/media-embed-template-tags.html b/docs/en_US/media-embed-template-tags.html index 900e3c8..9ebcf47 100644 --- a/docs/en_US/media-embed-template-tags.html +++ b/docs/en_US/media-embed-template-tags.html @@ -1,14 +1,14 @@
- ComicPress Core provides a handful of template tags to access the media attached to each post. + ComicPress Core provides a handful of template tags to access the media attached to each post.
- M()
retrieves the attachment info from the current post.
- Attachment info is returned as an array of IDs that the various backends can identify and work with:
+ M()
retrieves the attachment info from the current post.
+ Attachment info is returned as an array of IDs that the various backends can identify and work with:
@@ -18,6 +18,20 @@ foreach (M() as $image) { echo EM($image); } // we have a post and want its media $first_post = R('first'); foreach (M($first_post) as $image) { echo EM($image); } - -var_dump(M()); ++ +
+ EM()
returns information about a particular attached media.
+ The typical usage is to get the necessary HTML for embedding the specificed media, but other information can be retrieved:
+
+// we're in a Loop, so grab the current post's media and embed it +foreach (M() as $image) { + echo EM($image); // embed code for the default media, <img /> tags for images + echo EM($image, 'archive'); // embed code for the archive media + $attachment = EM($image, null, 'object'); // the ComicPressBackend object for the default image +}diff --git a/docs/en_US/storyline-basics.html b/docs/en_US/storyline-basics.html new file mode 100644 index 0000000..1ff8da6 --- /dev/null +++ b/docs/en_US/storyline-basics.html @@ -0,0 +1,77 @@ +
+ A word before you go any further: For ComicPress Core to work properly, posts can only be in one category! + ComicPress Core will reject any post in more than one category. If you want to put your posts in additional taxonomies, use tags. +
+ ++ A storyline in ComicPress Core parlance is a set of ordered, structured categories. + By default, categories in WordPress maintain only parent to child relationships — a category knows if it has a parent, and what that parent is. See the category list below: +
+ ++ While WordPress stores parent/child relationships, it does not store the order of all of the children underneath of a parent (the siblings). It always sorts them alphabetically by name. + This is bad for Websites that want to run structured sequential creative works, as that means you'd have to name your categories in a way that would cause them to sort + alphabetically, making the names nonsensical: +
+ ++ ComicPress Core allows you to sort your categories in any order, and that order is stored within ComicPress Core's own configuration. + This would allow you to ensure that My Funny Comic always appears before My Serious Comic, + no matter how many children My Comics has. +
+ +
+ In order for theme developers to be able to access this sort ordering information, ComicPress Core provides two template tags called SL()
and SC()
+ to retrieve information about the structure of categories. It's a much richer interface than WordPress's provided interface, because they always return hierarchical information:
+
+foreach (SL() as $category_id => $info) { + $category = get_category($category_id); + printf('Category %d is %d levels deep', $category->name, $info['level']); +} + +// by default, SC() returns categories relative to the current post +$next = SC('next'); +$previous = SC('previous'); +$parent = SC('parent'); + +// or you can provide a category to be relative to +$next_from_three = SC('next', 3); +$previous_to_chapter_four = SC('previous', 'chapter-four'); ++ +
+ Since ComicPress Core knows about the structure of your storyline, you can use ComicPress Core's advanced post search template tags to search subsets of your categories. + This is where a cool interactive goes that illustrates this complex process. +
\ No newline at end of file diff --git a/docs/en_US/storyline-post-template-tags.html b/docs/en_US/storyline-post-template-tags.html index eb11eff..086d175 100644 --- a/docs/en_US/storyline-post-template-tags.html +++ b/docs/en_US/storyline-post-template-tags.html @@ -1,8 +1,8 @@
- ComicPress Core provides a number of functions that allow you to traverse the storyline structure created from your blog's categories.
- Technical details about these template tags can be found in the functions.inc
file within your ComicPress Core installation.
+ ComicPress Core provides a number of functions that allow you to traverse the storyline structure created from your blog's categories.
+ Technical details about these template tags can be found in the functions.inc
file within your ComicPress Core installation.
- SL()
and SC()
give you access to the current storyline category information.
- SL()
lists all of the categories, in order, with the necessary metadata to traverse and understand the structure.
- SC()
lets you quickly traverse the storyline, returning category objects as it goes.
-
-foreach (SL() as $category_id => $info) { - $category = get_category($category_id); - printf('Category %d is %d levels deep', $category->name, $info['level']); -} - -// by default, SC() returns categories relative to the current post -$next = SC('next'); -$previous = SC('previous'); -$parent = SC('parent'); - -// or you can provide a category to be relative to -$next_from_three = SC('next', 3); -$previous_to_chapter_four = SC('previous', 'chapter-four'); -diff --git a/docs/en_US/storyline-traversal.html b/docs/en_US/storyline-traversal.html new file mode 100644 index 0000000..09e7594 --- /dev/null +++ b/docs/en_US/storyline-traversal.html @@ -0,0 +1,31 @@ +
+ ComicPress Core provides functions for traversing the storyline categories themselves. + These are used to find the adjacent (previous, next, parent) categories of a particular category, and to + find how deep in the hierarchy a category is located. +
+ +
+ SL()
and SC()
give you access to the current storyline category information.
+ SL()
lists all of the categories, in order, with the necessary metadata to traverse and understand the structure.
+ SC()
lets you quickly traverse the storyline, returning category objects as it goes.
+
+foreach (SL() as $category_id => $info) { + $category = get_category($category_id); + printf('Category %d is %d levels deep', $category->name, $info['level']); +} + +// by default, SC() returns categories relative to the current post +$next = SC('next'); +$previous = SC('previous'); +$parent = SC('parent'); + +// or you can provide a category to be relative to +$next_from_three = SC('next', 3); +$previous_to_chapter_four = SC('previous', 'chapter-four'); +