{"id":16419,"date":"2012-01-12T16:49:39","date_gmt":"2012-01-12T16:49:39","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/cursorial\/"},"modified":"2012-02-06T19:57:19","modified_gmt":"2012-02-06T19:57:19","slug":"cursorial","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/cursorial\/","author":8832613,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1","stable_tag":"1.1","tested":"3.3.2","requires":"3.2.1","requires_php":"","requires_plugins":"","header_name":"Cursorial","header_author":"Klandestino","header_description":"","assets_banners_color":"","last_updated":"2012-02-06 19:57:19","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/klandestino\/cursorial","header_author_uri":"http:\/\/klandestino.se","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1750,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1","1.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1443721","resolution":"1","location":"plugin"}},"screenshots":{"1":"An overview of the administration."}},"plugin_section":[],"plugin_tags":[529,21369,527,1840,21370,86],"plugin_category":[46],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-16419","plugin","type-plugin","status-closed","hentry","plugin_tags-content","plugin_tags-cursorial","plugin_tags-custom","plugin_tags-editing","plugin_tags-loops","plugin_tags-post","plugin_category-editor-and-writing","plugin_committers-spurge"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/cursorial.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/cursorial\/trunk\/screenshot-1.png?rev=1443721","caption":"An overview of the administration."}],"raw_content":"<!--section=description-->\n<p>With this plugin you can create your own <a href=\"http:\/\/codex.wordpress.org\/The_Loop\" title=\"The Loop \u00ab Wordpress Codex\">loops<\/a>\nand manage them with a simple drag-and-drop interface.<\/p>\n <p>Register one or more loops in your theme's <code>function.php<\/code> and then use them as any other loop in your theme with <code>have_posts()<\/code>, <code>the_post()<\/code>\netc. Editors can then manage these loops in the administration by simply drag posts to these loops or between them and override the posts' content if they like. They'll find posts in a search box just next to the loops.<\/p>\n <p><strong>The loops can be configured to ...<\/strong><\/p>\n <ul>\n<li>allow just a limited number of posts,<\/li>\n<li>allow just a specified set of post types,<\/li>\n<li>to have posts with children (like nested loops, related content etc),<\/li>\n<li>make posts' content overrideable and optional,<\/li>\n<li>be set together in the administration,<\/li>\n<li>and use images fetched from content or the featured image.<\/li>\n<\/ul>\n <p><strong>This plugin also comes with a widget that ...<\/strong><\/p>\n <ul>\n<li>displays a registered loop<\/li>\n<li>or creates one for you.<\/li>\n<\/ul>\n <h4>No additional database tables or writeable directories are added<\/h4>\n <p>This plugin will simply register a hidden <a href=\"http:\/\/codex.wordpress.org\/Post_Types\" title=\"Post Types \u00ab Wordpress Codex\">custom post type<\/a> and a <a href=\"http:\/\/codex.wordpress.org\/Taxonomies\" title=\"Taxonomies \u00ab Wordpress Codex\">custom taxonomy<\/a>. It's therefore installable\/runnable on most kinds of web hosts\/environments.<\/p>\n <h4>More info, wiki and issue tracker<\/h4>\n <p>https:\/\/github.com\/klandestino\/cursorial<\/p>\n\n<!--section=installation-->\n<h4>1. Install the plugin<\/h4>\n <p>You can install Cursorial using the built in Wordpress plugin installer. If you wish to install Cursorial manually, make sure you've uploaded the plugin to <code>wp-content\/plugins\/cursorial<\/code>.<\/p>\n <p>Activate the plugin in the <em>Plugins<\/em> admin panel using the <em>Activate<\/em>\nlink. You'll then be able to register your loops and use the widget that follows with this plugin.<\/p>\n <h4>2. How to use the widget<\/h4>\n <p>Drag the <em>Cursorial Widget<\/em> to any preferable sidebar in <em>Widget<\/em> admin panel found in <em>Appearence<\/em>. You'll then see a list of available loops, called blocks, if you've registered any. If not, you'll be able to create one for the current widget by checking the <em>Custom block<\/em>\nradio button. You can set the maximum number of posts and what fields that will be available.<\/p>\n <p>All widget-created blocks are then found in the <em>Custom Widget Blocks<\/em>\nadmin panel found in the <em>Cursorial<\/em> menu.<\/p>\n <h4>3. Register your loops in the theme's function.php<\/h4>\n <p>Use <code>register_cursorial()<\/code> to register loops. This function takes two arguments. First an array with the loops you want, and then another array with information about how your loops will be shown for the editors in the administration.<\/p>\n <p>Here's some lines of code:<\/p>\n <pre><code>add_action( 'after_setup_theme', 'your_theme_setup' );  function your_theme_setup() {     if ( function_exists( 'register_cursorial' ) ) {         register_cursorial(             array( \/\/ Array with the custom loops                 'main-feed' =&gt; array( \/\/ The key is the name of the loop                     'label' =&gt; __( 'Main Feed' ), \/\/ The official label of the loop                     'max' =&gt; 2, \/\/ The maximum amount of allowed posts                     'post_type' =&gt; array( 'page' ), \/\/ Limit posts with post type. Can be defined as an array or a string                     'childs' =&gt; array( \/\/ If set, all posts in this loop can have childs                         'max' =&gt; 2, \/\/ The maximum amount of allowed childs posts                         'post_type' =&gt; 'post', \/\/ Limit child posts with post type                         'fields' =&gt; array( \/\/ Set the displayable child post field                             'post_title' =&gt; array( \/\/ The key is the name of the post field                                 'optional' =&gt; false, \/\/ If set to true, the field can be hidden by the editor in the admin                                 'overridable' =&gt; true \/\/ If set to true, the field's content can be overridden by the editor in the admin                             ),                             'post_date' =&gt; array(                                 'optional' =&gt; true,                                 'overridable' =&gt; false                             )                         )                     ),                     'fields' =&gt; array( \/\/ Set the displayable post field                         'post_title' =&gt; array(                             'optional' =&gt; false,                             'overridable' =&gt; true                         ),                         'post_excerpt' =&gt; array(                             'optional' =&gt; false,                             'overridable' =&gt; true                         ),                         'image' =&gt; array( \/\/ This field will fetch the first occuring image from the post                             'optional' =&gt; true,                             'overridable' =&gt; true                         )                     )                 ),                 'second-feed' =&gt; array(                     'label' =&gt; __( 'Secondary Feed' ),                     'max' =&gt; 4,                     'fields' =&gt; array(                         'post_title' =&gt; array(                             'optional' =&gt; false,                             'overridable' =&gt; false                         ),                         'post_excerpt' =&gt; array(                             'optional' =&gt; true,                             'overridable' =&gt; true                         ),                         'post_date' =&gt; array(                             'optional' =&gt; false,                             'overridable' =&gt; false                         )                     )                 )             ),             array( \/\/ Second argument is an array with some admin config                 __( 'Home' ) =&gt; array( \/\/ The key is the name of the page where editors can edit specified loops                     'main-feed' =&gt; array( \/\/ The key is the name of the loop that will be editable                         'x' =&gt; 0, \/\/ In what column this loop should be placed                         'y' =&gt; 0, \/\/ In that row this loop should be placed                         'width' =&gt; 2, \/\/ How many columns this loop is wide                         'height' =&gt; 7 \/\/ How many rows this loop is tall                     ),                     'banner-space-1' =&gt; array( \/\/ If there's no matched loop with this name, the space will be occupied by a dummy placeholder                         'x' =&gt; 2,                         'y' =&gt; 0,                         'width' =&gt; 1,                         'height' =&gt; 2,                         'dummy-title' =&gt; __( 'Banners' ), \/\/ A customized title                         'dummy-description' =&gt; __( 'On front page there are a couple of banners here.' ) \/\/ A customized description                     ),                     'second-feed' =&gt; array(                         'x' =&gt; 2,                         'y' =&gt; 2,                         'width' =&gt; 1,                         'height' =&gt; 3                     )                 ),                 __( 'Sub pages' ) =&gt; array( \/\/ Another admin page with a set of loops                     '_dummy' =&gt; array(                         'x' =&gt; 0,                         'y' =&gt; 0,                         'width' =&gt; 2,                         'height' =&gt; 7,                         'dummy-title' =&gt; __( 'Page or post content' ),                         'dummy-description' =&gt; __( 'The current page or post content.' )                     ),                     'second-feed' =&gt; array(                         'x' =&gt; 2,                         'y' =&gt; 0,                         'width' =&gt; 1,                         'height' =&gt; 7                     )                 )             )         );     } } <\/code><\/pre>\n <h4>4. Query the posts<\/h4>\n <p>There are two ways to print the posts from your customized loops.<\/p>\n <p>You can embed a loop anywhere in your theme with <code>query_cursorial_posts()<\/code>. This will work almost exactly as if you used <code>query_posts()<\/code> (see <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/query_posts\" title=\"Function Reference\/query posts \u00ab Wordpress Codex\">reference<\/a>). The only difference is that you'll not be able to customize the loop with arguments. <code>query_cursorial_posts()<\/code> takes only one argument, and that's the name of the loop that you want to get posts from. If you omit this argument, the function will query posts from the first occuring registered loop.<\/p>\n <p>Example:<\/p>\n <pre><code>&lt;?php query_cursorial_posts( 'main-feed' ); ?&gt; &lt;?php while( have_posts() ): the_post(); ?&gt;     &lt;div class=\"post\"&gt;         &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;\/h2&gt;         &lt;?php the_cursorial_image(); ?&gt;         &lt;?php the_excerpt(); ?&gt;     &lt;\/div&gt; &lt;?php endwhile; ?&gt; <\/code><\/pre>\n <p>Here with the <code>get_template_part()<\/code>:<\/p>\n <pre><code>&lt;?php query_cursorial_posts( 'main-feed' ); ?&gt; &lt;?php while( have_posts() ): the_post(); ?&gt;     &lt;?php get_template_part( 'content', get_post_type() ); ?&gt; &lt;?php endwhile; ?&gt; <\/code><\/pre>\n <p>If you want to place all your custom loop code in some other template files you can use <code>get_cursorial_block()<\/code>. It will call templates called <code>cursorial.php<\/code> or <code>cursorial-LOOP-NAME.php<\/code>.<\/p>\n <p>Example:<\/p>\n <pre><code>\/\/ In home.php &lt;?php get_cursorial_block( 'main-feed' ); ?&gt;  \/\/ In cursorial-main-feed.php &lt;?php while( have_posts() ): the_post(); ?&gt;     &lt;?php get_template_part( 'content', get_post_type() ); ?&gt; &lt;?php endwhile; ?&gt; <\/code><\/pre>\n <h4>5. Print images, get it's depth and check if a post field is hidden<\/h4>\n <p>If you are using the field <code>image<\/code> (witch is a non wordpress field, added by this plugin), an image is fetched either from a featured image or the first occuring image in the content. It can then be overrided by the editor if you set the field to be overrideable. In order to print this image you need to call <code>the_cursorial_image()<\/code> or     get_the_cursorial_image() (witch will return the image tag instead of printing it).<\/p>\n <p>If you've set a loop to support child posts, then you'll need to know what posts are childs or not. With <code>the_cursorial_depth()<\/code> and     get_the_cursorial_depth() you'll get an integer for what depth the current post has. 0 for parents and 1 for childs. An important thing to know is that both parents and childs are found in the same loop. There are no nested loops of any kind.<\/p>\n <p>If you've set a field to be <code>optional<\/code>, an editor may have hidden some posts' fields. You'll notice that the template tag for that field will not return anything. But in some cases you may want to also hide some HTML that wraps the field. With <code>is_cursorial_field_hidden( 'field_name' )<\/code> you'll know if the field is set to be hidden.<\/p>\n <p>Example:<\/p>\n <pre><code>&lt;?php while ( have_posts() ) : the_post(); ?&gt;     &lt;div class=\"post&lt;?php echo get_the_cursorial_depth() ? ' post-child' : ' post-parent'; ?&gt;         &lt;h2&gt;&lt;a href=\"&lt;?php echo esc_url( get_permalink() ); ?&gt;\" title=\"&lt;?php esc_attr( get_the_title() ); ?&gt;\"&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h2&gt;         &lt;?php if ( ! is_cursorial_field_hidden( 'image' ) ) : ?&gt;             &lt;div class=\"image\"&gt;                 &lt;?php the_cursorial_image(); ?&gt;             &lt;\/div&gt;         &lt;?php endif; ?&gt;     &lt;\/div&gt; &lt;?php endwhile; ?&gt; <\/code><\/pre>\n\n<!--section=faq-->\n<h4>In what languages are this plugin available?<\/h4>\n <ul>\n<li>English (built-in)<\/li>\n<li>Svenska<\/li>\n<\/ul>\n <h4>Can I override the widget output template?<\/h4>\n <p>Yep. Create a template in your theme and call it <code>cursorial-widget.php<\/code>. The loop in the template file is already initiated. You'll just need to do the while loop like so ...<\/p>\n <pre><code>&lt;ul&gt;     &lt;?php     # In cursorial-widget.php     while ( have_posts() ) : the_post(); ?&gt;         &lt;li&gt;             &lt;h4&gt;&lt;a href=\"&lt;?php echo esc_url( get_permalink() ); ?&gt;\" title=\"&lt;?php echo esc_attr( get_the_title() ); ?&gt;\"&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h4&gt;         &lt;\/li&gt;     &lt;?php endwhile; ?&gt; &lt;\/ul&gt; <\/code><\/pre>\n <h4>Can I override the administration templates?<\/h4>\n <p>Yes you can.<\/p>\n <p>Create a template in you theme and call it <code>cursorial-admin-blocks.php<\/code>\nor <code>cursorial-admin-blocks-BLOCK-ADMIN-NAME.php<\/code>. The BLOCK-ADMIN-NAME should be replaced by the key for the specified group of blocks in the admin array in <code>register_cursorial()<\/code>.<\/p>\n <p>The administration functionality is mainly done with some jQuery-plugins. See \u00b4templates\/cursorial-admin-block.php\u00b4 in the plugin directory to see how the jQuery plugins are applied.<\/p>\n\n<!--section=changelog-->\n<h4>v1.1<\/h4>\n <p><strong>Bugfixes<\/strong><\/p>\n <ul>\n<li>Fixed issue with siblings being removed when removing childs.<\/li>\n<li>Even more content override that might solve some unwanted override savings.<\/li>\n<li>Fixed a javascript error that occured in some cases.<\/li>\n<\/ul>\n <p><strong>New features<\/strong><\/p>\n <ul>\n<li>Added widget that displays existing blocks or creates new ones.<\/li>\n<li>Widget have overridable widget templates for both public use and the admin.<\/li>\n<li>Support for blocks to limit posts by post-type.<\/li>\n<\/ul>\n <h4>v1.0.1<\/h4>\n <p><strong>Bugfixes<\/strong><\/p>\n <ul>\n<li>Fixed issue with hidden image selector.<\/li>\n<li>Posts' order failed in chrome and maybe some other browsers.<\/li>\n<li>Fixed issue with using the \"Insert into Post\"-button in image selector.<\/li>\n<\/ul>\n <p><strong>New features<\/strong><\/p>\n <ul>\n<li>Search queries looks for all post types except cursorials. Thereby you can add pages and custom post types to your cursorial loops.<\/li>\n<\/ul>\n <h4>v1.0<\/h4>\n <p><strong>Bugfixes<\/strong><\/p>\n <ul>\n<li>Deleting posts with childs must also remove childs.<\/li>\n<li>Image won't change until the block is saved.<\/li>\n<li>You can't choosa an image override if there's no cursurial representative.<\/li>\n<li>Search seems to get all posts even if they don't match.<\/li>\n<li>Templates are located but not loaded.<\/li>\n<li>Default generated excerpt was saved as overrides even if there was no difference from the original.<\/li>\n<\/ul>\n <p><strong>New features<\/strong><\/p>\n <ul>\n<li>Search posts by date.<\/li>\n<li>First occuring block is used as default if no block is specified in get_cursorial_block() and query_cursorial_posts().<\/li>\n<li>Search result is limited.<\/li>\n<\/ul>\n <h4>v0.9.3<\/h4>\n <ul>\n<li>Administration interface have a saved\/unsaved status indicator.<\/li>\n<li>There's a save all blocks button.<\/li>\n<li>The jQuery block plugin have some of it's internal functions available from outside.<\/li>\n<li>Swedish translation.<\/li>\n<\/ul>\n <h4>v0.9.2<\/h4>\n <ul>\n<li>An optional show\/hide option on fields.<\/li>\n<\/ul>\n <h4>v0.9.1<\/h4>\n <ul>\n<li>Maximum number of posts can be set for both blocks and post childs.<\/li>\n<\/ul>\n <h4>v0.9<\/h4>\n <p>First stable beta release with some of the main features.<\/p>\n <ul>\n<li>Register blocks with custom loops and gather them in the administration.<\/li>\n<li>Search posts in the administration and drag posts into cursorial blocks.<\/li>\n<li>Drag posts between blocks.<\/li>\n<li>Override posts' contents.<\/li>\n<li>Images will be set by wordpress' own image library.<\/li>\n<li>Posts can be set to have childs.<\/li>\n<li>Admin pages templates are overridable.<\/li>\n<li>Loops for displaying block posts are available through both a query method and a template fetcher.<\/li>\n<\/ul>","raw_excerpt":"Create custom loops and edit it&#039;s posts with an easy drag-and-drop\ninterface. Override the post&#039;s title, content, excerpt and images.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/16419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=16419"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/spurge"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=16419"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=16419"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=16419"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=16419"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=16419"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=16419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}