Categories

  • Access & Security 95
  • Administration 171
  • Advertisement 92
  • Audio & Video 66
  • Author & Content 99
  • Comments 96
  • Communication 110
  • Communities & Forums 84
  • Development 47
  • E-Commerce 76
  • Email Management 53
  • Events & Calendars 80
  • Language 25
  • Map & Weather 44
  • Migration & Conversion 28
  • Miscellaneous 254
  • Mobile 15
  • Photos 143
  • Plugins 260
  • SEO & Site Speed 118
  • Social 186
  • Theme Enhancement 169



  • Add this plugin to a List

    You need to be logged in to add this plugin to your list.

    Spots

    Add to List

    Here at interconnect/it we have a policy of developing client sites with the premise of “content manage everything!” That means the little notices on sites, minor widgets and so on should not only be content managed, but they should be easy for both an end-user and a developer to work with.

    To that end, we developed Spots. This creates a custom post type that allows you to create widgets using a visual editor, whilst also giving developers an easy hook for the creation of content managable elements within a theme.

    The plugin now uses caching in order to help ensure that the load on a typical site is kept to a minimum. Performance is important!

    The plugin is prepared for translation, if you’d like to drop us a line about your translation you can contact us through our website.

    Developer Notes

    Spots provides 2 template tags for developers to use shown below with their supported arguments.

    icit_spot( $id_or_name, $template );
    
    • $id_or_name: Required. A numeric ID or the name of a spot as a string.
    • $template: Optional. A string used in a call to get_template_part()

    This template tag always echos out the spot.

    icit_get_spot( $id_or_name, $template, $echo );
    

    Same as the above with an extra argument:

    • $echo: Optional. Defaults to false. A boolean to indicate whether to echo the spot content or just return it.

    Basic Usage

    You can use spots to replace boilerplate text in your themes. If you have areas in your themes where typically you would hard code the text you could use the following code:

    <?php
    if ( function_exists( 'icit_spot' ) )
        icit_spot( 'Copyright' );
    ?>
    

    The above code would output the contents of a spot titled ‘Copyright’. If the spot does not exist it will be created as a draft. Spots in draft mode are only visible to logged in users with editing capabilities.

    Templates

    The plugin will initially look for a file in your theme using the get_template_part() function. If you have a file called spot.php in your theme that will be the default template for all spots. The icit_spot() function can take a second parameter for the template part to use for example:

    <?php
    if ( function_exists( 'icit_spot' ) )
        icit_spot( 'Copyright', 'copyright' );
    ?>
    

    The above code will make the plugin look in your theme folder for a file called spot-copyright.php to use for the output. If not available it will fall back to spot.php and if that is not available it will simply output the spot contents.

    Use templates when you want to display a featured image from a spot or if you require some additional/alternative markup for the spot. Spots are just like posts, so in the templates you retrieve the contents of the spot using the_content() just as would in the loop.

    Basic spot template example:

    <div class="spot">
        <?php the_content(); ?>
    </div>
    

    Spot template with featured image:

    <div class="spot-with-image">
        <?php
            if ( has_post_thumbnail() )
                the_post_thumbnail( 'medium' );
            the_content(); ?>
    </div>
    

    Additional

    There are many filters and hooks available to get even more out of spots so drop by the plugin homepage or use the forums if there is something you need to do with spots but aren’t sure how.

    Rate This Plugin

    Please Login to Rate this Plugin!

    Function

    Feature

    Support

    0 Votes
    Not Rated Yet

    Wordpress.org Stats

    Ratings5
    Votes10
    Downloads38,630
    Last Updated1464 Days ago
    Published15 years ago

    Report Wrong Category!