Update documentation
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 23 Mar 2015 20:00:58 +0000 (16:00 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 23 Mar 2015 20:00:58 +0000 (16:00 -0400)
Create Docs for setting up plugin

README.md [new file with mode: 0644]
controllers/admin.php
glm-blocks.php

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..d071794
--- /dev/null
+++ b/README.md
@@ -0,0 +1,59 @@
+# Gaslight Media Blocks Application
+
+##Setup Instructions
+###Install plugin
+    git clone git@cvs2:WP-Plugins/glm-blocks.git
+###Setup plugin in front-page.php
+Default setup
+```
+    <?php glm_blocks_show();?>
+```
+Default setup from the glmTheme (grunt-init)
+```
+<?php get_template_part('parts/glm-blocks');?>
+```
+
+Customize Output of Blocks.
+```
+<?php if(function_exists('fetch_all_glm_blocks')):?>
+<?php $blocks = fetch_all_glm_blocks();?>
+<div class="blocks">
+    <?php foreach ($blocks as $block):?>
+    <div class="text-center small-12 large-4 columns large-text-left blocks">
+            <?php if($block->url):?>
+            <a href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
+            <?php endif;?>
+            <?php echo $block->thumbnail;?>
+            <?php if($block->url):?>
+            </a>
+            <?php endif;?>
+            <?php if($block->url):?>
+            <a class="title-posts" href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
+            <?php endif;?>
+                <h1><?php echo $block->post_title;?></h1>
+            <?php if($block->url):?>
+            </a>
+             <?php endif;?>
+        <p><?php echo $block->post_excerpt;?></p>
+        <a class="blocks-readmore" href="<?php echo $block->url;?>">Read More...</a>
+    </div>
+    <?php endforeach;?>
+</div>
+<div class="separator"><hr></div>
+<?php endif;?>
+```
+
+##Directories and Files Structure
+###controllers
+    admin.php
+    front.php
+###models
+    block.php
+###views
+    admin
+        metaBoxes.php
+    front
+        showBlocks.php
+###glm-blocks (root)
+    glm-blocks.php
+    README.md
index 0742328..f16304c 100644 (file)
@@ -22,13 +22,18 @@ class glm_blocks_admin
         add_action('admin_init', array($this, 'remove_elements'));
     }
 
+    /**
+     * Sets the pluginDirName variable
+     */
     public function setPluginDir($dir)
     {
         $this->pluginDirName = $dir;
     }
 
 
-
+    /**
+     * Hide certain elements from the normal post edit page. 
+     */
     function remove_elements()
     {
         if(    isset($_GET['post']) && $_GET['post']
index dabdc69..5ac8ed6 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
 Plugin Name: GLM Blocks
-Version: 1.0.1
+Version: 1.0.2
 Description: Displays blocks of content managed from the admin under Blocks.
 Author: Steve Sutton <steve@gaslightmedia.com>
 Author URI: http://www.gaslightmedia.com