Changeset 561951
- Timestamp:
- 06/21/2012 07:33:03 PM (14 years ago)
- Location:
- page-specific-sidebars
- Files:
-
- 5 added
- 3 edited
-
tags/2.0/views/page-sidebar-options-view.php (modified) (1 diff)
-
trunk/Read.ME (modified) (2 diffs)
-
trunk/assets (added)
-
trunk/assets/ic-logo.jpg (added)
-
trunk/assets/page-spec_scripts.js (added)
-
trunk/assets/page_spec_styles.css (added)
-
trunk/page-sidebar.php (modified) (3 diffs)
-
trunk/screenshot-3.png (added)
Legend:
- Unmodified
- Added
- Removed
-
page-specific-sidebars/tags/2.0/views/page-sidebar-options-view.php
r509987 r561951 1 <div class="wrap" id=" avalara-settings">1 <div class="wrap" id="page-specific-sidebar-settings"> 2 2 <div id="icon-options-general" class="icon32"></div> 3 <h2>Page Specific Sidebar Settings</h2> 4 <?php if( $_SERVER['REQUEST_METHOD'] == "POST" ) echo "<div id='message' class='updated'>Page Sidebars Settings Successfully Saved!</div>"; ?> 5 <?php //parent::fprint_r( $this->valid->all_formdata() ); ?> 6 <form action="" method="post"> 7 <ul> 8 <li><label for="primary-slug">Primary Sidebar Slug</label></li> 9 <li><input id="primary-slug" type="text" name="primary_sidebar_slug" value="<?php echo $this->widget_name; ?>"/></li> 10 <li><label for="home-id">Home Page ID *</label></li> 11 <li><input id="home-id" type="text" name="home_page_id" value="<?php echo $this->home_id; ?>"/></li> 12 <li>* - Home page with blog posts have issues with the page ID being overridden. This ensures that the right page ID is being used. (optional)</li> 13 <li><button type="submit" name="save_page_data">Update Settings</button></li> 14 </ul> 15 </form> 3 <h2>Page Specific Sidebar Plugin</h2> 4 <div id="body-wrap" class="meta-box-sortables ui-sortable"> 5 <div id="metabox_desc" class="postbox"> 6 <div class="handlediv" title="Click to toggle"> 7 <br> 8 </div> 9 <div class="hndle"> 10 <h3><ul class="top-menu clearfix"> 11 <li class="current-menu-tab menu-item"><a href="#settings">Settings</a></li> 12 <li class="menu-item"><a href="#help">Help</a></li> 13 </ul></h3> 14 </div> 15 <div class="group settings current-tab inside"> 16 <?php if( $_SERVER['REQUEST_METHOD'] == "POST" ) echo "<div id='message' class='updated'>Page Sidebars Settings Successfully Saved!</div>"; ?> 17 <?php //parent::fprint_r( $this->valid->all_formdata() ); ?> 18 <form action="" method="post"> 19 <ul> 20 <li><label for="primary-slug">Primary Sidebar Slug</label></li> 21 <li><input id="primary-slug" type="text" name="primary_sidebar_slug" value="<?php echo $this->widget_name; ?>"/></li> 22 <li><label for="home-id">Home Page ID *</label></li> 23 <li><input id="home-id" type="text" name="home_page_id" value="<?php echo $this->home_pg_id; ?>"/></li> 24 <li>* - Home page with blog posts have issues with the page ID being overridden. This ensures that the right page ID is being used. (optional)</li> 25 <li><button type="submit" name="save_page_data">Update Settings</button></li> 26 </ul> 27 </form> 28 </div> 29 <div class="group help inside"> 30 <p>To use this plugin, simply got to a page you wish to overwrite or extend the sidebar on, and select the apropriate checkbox:</p> 31 <img src="<?php echo DGSIDEBAR_URL . '/screenshot-1.png'; ?>"/> 32 <p>Add the Widgets to the sidebar as you wish:</p> 33 <img src="<?php echo DGSIDEBAR_URL . '/screenshot-2.png'; ?>"/> 34 <p> 35 This Plugin is theme sensitive. That means the sidebar naming is dependant on the theme. Some themes name the primary sidebar 36 "sidebar-primary", others name it "sidebar-1". To find the name of the sidebar, simply right click on the primary sidebar (widget page) 37 and view the page source. See image below: 38 </p> 39 <img src="<?php echo DGSIDEBAR_URL . '/screenshot-3.png'; ?>"/> 40 <p> 41 Homepage ID is the post_id of your Homepage. To find the page id, simply go to Pages->Home (orwhatever your home page is named) and click edit. 42 In the address bar of your browser, you'll see something like mysite.com/wp-admin/post.php?post=x where x is some number. That is the Page ID. 43 </p> 44 </div> 45 </div> 46 </div> 47 <div id="sidebar-wrap"> 48 <?php require_once 'desc.php'; ?> 49 </div> 16 50 </div> -
page-specific-sidebars/trunk/Read.ME
r509979 r561951 3 3 Tags: widgets, sidebar, role based 4 4 Requires at least: 3.0 5 Tested up to: 3. 16 Stable tag: 2. 05 Tested up to: 3.4 6 Stable tag: 2.1 7 7 8 8 ==Short Description == … … 50 50 == Changelog == 51 51 52 52 2012-06-21 - Added help to settings page. 53 53 54 54 == Upgrade Notice == -
page-specific-sidebars/trunk/page-sidebar.php
r509979 r561951 6 6 * Description: Allows a page to be assigned a special sidebar. Either overwrites the generic sidebar call or adds. For targeting Sidebars by name, see plugin option page 7 7 * to the existing generic sidebar 8 * Version: 2. 08 * Version: 2.1 9 9 **/ 10 10 … … 30 30 31 31 if( !defined( 'DGSIDEBAR_DIR' ) ) define( 'DGSIDEBAR_DIR', dirname( __FILE__ ) ) ; 32 if( !defined( 'DGSIDEBAR_URL' ) ) define( 'DGSIDEBAR_URL', str_replace( ABSPATH, site_url( '/' ), DGSIDEBAR_DIR ) ) ; 33 32 34 class DGPageSidebarCustom{ 33 35 … … 48 50 */ 49 51 public function options_page_init(){ 50 if( !current_user_can( 'administrator' ) ) return; 51 add_options_page(__('Page Sidebar Settings'), __('Page Sidebar Settings'), 'read', 'page-sidebar-settings', array($this, 'option_page')); 52 if( !current_user_can( 'administrator' ) ) return; 53 $hooks = array(); 54 $hooks[] = add_options_page( __( 'Page Sidebar Settings' ), __( 'Page Sidebar Settings' ), 'read', 'page-sidebar-settings', array( $this, 'option_page' ) ); 55 foreach( $hooks as $hook ) add_action( "admin_print_styles-{$hook}", array($this, 'load_assets' ) ); 56 } 57 58 public function load_assets(){ 59 wp_enqueue_style( 'page-spec-sidebar-css', DGSIDEBAR_URL . '/assets/page_spec_styles.css' ); 60 wp_enqueue_script( 'page-spec-sidebar-js', DGSIDEBAR_URL . '/assets/page-spec_scripts.js' ); 52 61 } 53 62
Note: See TracChangeset
for help on using the changeset viewer.