Subscribe via Feedburner Flickr Images Youtube Profile LinkedIn Profile
HostGator

T2: Templates System

Thumbnail for T2: Templates System

Finally, new templates system that will be used for all GD Star Rating renderings is ready. At this point not all rendering is done using T2, but it will be soon, because it requires a lot of testing and tweaking. At this point standard rating for posts and comments are converted to T2 system. Next will follow all custom function, RSS feed render and multi ratings. All that will be done in the next 2 or 3 releases.

t2 grid 300x125 T2: Templates System

T2: Templates Grid

Main T2 panel shows all the templates in the database. Some templates can’t delete and that are default templates. You need this, and they are installed when you first install plugin or update from some of the older versions. Beside the name of each template you can see type of the each template. Some of the template types have a value in the tag column, and that means that these templates can be used withing some other templates, some sort of co-dependency. You can filter the list by template type.

t2 editor 300x159 T2: Templates System

T2: Editor

Each template can have one or more elements. What element will be used for rendering depend on parameters. In most cases there is one template for each type. But rating text have 3 templates, one normal rendering and 2 if the post rating is time restricted. For each template there is a number of template tags that can be used. With each template element you have a list of tags supported. Also, some of the tags as I mentioned are actual whole templates, and in that case you can see a selection box allowing you to choose with template will be used.

t2 elements 208x300 T2: Templates System

T2: Tags

All this will allow you to have multiple templates for each rendering type, and use different ones on different pages or categories (still in works). All functions and shortcodes will be modified to use templates. At this point I still didn’t rewrote all the renderings to use T2, but standard rating block, comment rating block and dependent templates are implemented. Also, because of this, some of the settings are removed. So, you don’t have options to align rating block, because all that will be done using CSS in the templates. This will give you much more flexibility in creating templates to fit the themes.

I know that maybe this looks complicated at first look, but try it and you will see that this much more powerful than previous system. I have added default template selection for posts and pages and comments, so create your own templates and see how they work. In the next week or so, I will add one more post to describe in details creation and use of one template for standard rating block.

GD Star Rating
loading...

Share this:

del.icio.us DiGG Google StumbleUpon Google Buzz Microsoft Live MiXX RSS PDF
T2: Templates System, 7.5 out of 10 based on 115 ratings

11 Responses to “T2: Templates System”

  1. pankaj arya | April 26, 2009 at 10:36 AM

    Hi
    i am trying to display the Articles by rating on the left side of my wordpress blog.
    but unfortunately i am not able to make it working

    I scan all the documents of yours and didn’t find how to use template in sidebar

    some function i need to call in PHP ?

    or use this entire code in sidebar.php
    Rating: %RATING%/%MAX_RATING% (%VOTES% %WORD_VOTES% cast)
    Rating: %RATING%/%MAX_RATING% (%VOTES% %WORD_VOTES% cast)%TR_MONTHS% months, %TR_DAYS% days, %TR_HOURS% hours, %TR_MINUTES% minutes remaining.
    Voting Closed. Rating: %RATING%/%MAX_RATING% (%VOTES% %WORD_VOTES% cast)

    Unfortunately nothing is working for me.

    A small help from you will be higly appreciated.

    Thanks
    http://www.meraarticle.com

    GD Star Rating
    loading...
    • MillaN | April 26, 2009 at 11:04 AM

      There is a sidebar widget for this, and there is a function that does exactly the same thing as the widget, and list of parameters in the user guide.

      GD Star Rating
      loading...
  2. Danny | May 8, 2009 at 7:29 PM

    Hi Millan,

    I was just wondering, when will the feature I suggested here
    http://forum.gdragon.info/viewtopic.php?f=9&t=246

    be implemented ?

    Thanks
    Danny

    GD Star Rating
    loading...
    • MillaN | May 8, 2009 at 8:24 PM

      Multi reviews are implemented from version 1.1.5 or something like that, few weeks ago. I use it myself on my Dev4Press website for plugin reviews.

      GD Star Rating
      loading...
  3. David Bravo | May 10, 2009 at 12:34 PM

    Is there any shortcode for templates? I mean, I’ve created a template which is exactly how I need it, but I need to insert it on a text widget. Is this possible? I suppose I’d have to use the same function used for the widget (the widget using that template displays just fine), but how can I know it? Something like [starrating template='#4'] (for example) ?

    Thank you,
    Dave

    GD Star Rating
    loading...
    • MillaN | May 10, 2009 at 2:52 PM

      WordPress widgets don’t support shortcodes. Shortcodes can be used only within the post content. All GDSR widgets support templates. And all the widget custom functions support them also. I will publish new documentation in the next week or so.

      GD Star Rating
      loading...
      • David Bravo | May 10, 2009 at 3:05 PM

        Well, I’m quite in a hurry, so (sorry if this bothers you) I’ve found a very fast way to do what I need overwriting the default standar rating results database table with a simpler “pseudo-template” (based on your tags, of course).
        I really appreciate your dedication and kindness to answer our questions. :)

        Dave

        GD Star Rating
        loading...
  4. Jeff Dempsey | May 20, 2009 at 6:58 PM

    Using these custom templates is it possible to have the rating system redirect after voting? If not what java script file do I need to modify to accomplish this?

    GD Star Rating
    loading...
    • MillaN | May 20, 2009 at 7:36 PM

      No, it’s not. Javascript is devided in several files, and is compiled together based on several rules, so it’s not that easy to change that. Javascript files are in /code/js/ folder.

      GD Star Rating
      loading...

Trackbacks/Pingbacks

  1. Webmaster Crap » Blog Archive » T2: Templates System | GD Star Rating - April 21, 2009

    [...] See more here: T2: Templates System | GD Star Rating [...]

  2. GD Star Rating 1.2.0 | GD Star Rating - April 22, 2009

    [...] new templates system is described in much more details in the featured post, and I will just point few things out here. Currently standard rating and comments rating blocks [...]

Comments are closed.