Risultati della ricerca

TextPattern Plugins

inserito in tecnologia da fullo @ 18-09-2006 03:11

ful_ajax_gallery

Description

This plugin helps to create a dynamic archive browsing using ajax, it uses ajax to query the textpattern db and to retrieve post information such title, text and whatever.
The plugin is strongly ispired on the cbs_live_search but it doesn't use hardcoded query. So you can choose how to display your results simply creating a new layout form.

Release

v0.7

Download

Demo

http://php.fullo.net/textpattern/ click on "next" to start the demo

Reference

  • add in the <head> section of the page template the

    <txp:ful_ajax_gallery_js />
    it will add the necessaries javascript function to call ajax with prototype and scriptacoulus
  • the <txp:ful_ajax_gallery /> tag is the main tag of the plugin.

    This tag uses those attributes:

    • section: the section where to search data, note that is the same of custom_article
    • category: the category where to search data, note that is the same of custom_article
    • form: the form layout for the results
    • limit: how many articles are retrieved, note that is the same of custom_article
    • offset: the offset from which the data is retrieved, note that is the same of custom_article
    • label: show the menubar label
    • menu (true/false): show the menubar
    • sortby (posted): how to sort the results, note that is the same of custom_article
    • spinner (true/false): add the spinner div directly
    • top (true/false): add the top div directly
    • label_menu_next: the label for the 'next' link
    • label_menu_prev: the label for the 'prev' link
  • if you want to add the menu bar in another position you can use the tag <txp:ful_ajax_menu>
    it uses a limited sets of the attributes of <txp:ful_ajax_gallery />

    • section: the section where to search data, note that is the same of custom_article
    • category: the category where to search data, note that is the same of custom_article
    • form: the form layout for the results
    • limit: how many articles are retrieved, note that is the same of custom_article
    • offset: the offset from which the data is retrieved, note that is the same of custom_article
    • label (next/prev): used to create the link to previous o next articles

    and it need also a nested text as the label

  • if you want to add the ajax container for the article in another position you have to set the attribute top=false for
    <txp:ful_ajax_gallery /> and then you can use <txp:ful_ajax_top />.
    This tag accept 2 attributes and can manage text.

    • tag (div): the type of tag for the ajax container
    • class: the css class for the tag
      • as before if you want to add the ajax spinner in another position you have to set the attribute spinner=false for
        <txp:ful_ajax_gallery /> and then you can use <txp:ful_ajax_spinner />.
        This tag accept 2 attributes and can manage text.

        • tag (div): the type of tag for the ajax container
        • class: the css class for the tag
          • you can configure the default value for all the plugin changing the ful_ajax_config() array.

css style

Every object created by the plugin has its own css ID:

  • menu and menu links: ajax-menu, ajax-menu-next, ajax-menu-prev
  • title browsing (bottom interface): ful-ajax-bottom
  • article content: ful-ajax-top
  • spinner: ful-ajax-spinner

usage example

create a layout page, cloning the default template. Add then in the html head section the calling for the js libraries.
note that I\'ve installed prototype and scriptaculous in the /js directory

PHP:
  1. <script type="text/javascript" src="<txp:site_url/>js/prototype.js"></script>
  2. <script type="text/javascript" src="<txp:site_url/>js/scriptaculous.js"></script>
  3. <txp:full_ajax_gallery_js />

then in the body of the page I add the tag to create the ajax gallery

PHP:
  1. <h1>ajax article gallery</h1>
  2. <txp:ful_ajax_gallery limit="5" category="mycat" form="myform" />

now an archive gallery for the category mycat is created by textpattern, and I have also a 5 title pagination.
The archive uses a generic article form myform

PHP:
  1. <div class="articolo">
  2. <txp:ful_ajax_show_link form="myTopForm">##<txp:article_id />##<txp:title />&</txp:ful_ajax_show_link />
  3. </div>

it is very important that the value inserted in the ful_ajax_show_link tag start with ##ID-OF-THE-POST## This is due a
textpattern limitation which cannot permit to use a txp:tag inside another txp:tag as attribute. After that pattern you can add anything.
Here I use a article form called myTopForm.

PHP:
  1. <h2><txp:permlink><txp:title /></txp:permlink></h2>
  2. <txp:body />

if you want to add the spinner or the top container in another place you can change the page layout as follow:

PHP:
  1. <txp:ful_ajax_spinner><img src="path.to/spinner.img" alt="my ajax spinner" /></txp:ful_ajax_spinner>
  2.        
  3. <txp:ful_ajax_menu label="prev" limit="5" category="mycat" form="myform" menu="false" />
  4. <txp:ful_ajax_menu label="next" limit="5" category="mycat" form="myform" menu="false" />
  5.        
  6. // some html code here
  7.    
  8. <h1> ajax article gallery </h1>
  9. <txp:ful_ajax_gallery limit="5" category="mycat" form="myform" spinner="false" top="false" menu="false"/>
  10.        
  11. // some html code here
  12. <txp:ful_ajax_top class="myCSS" tag="p">SOME TEXT HERE</txp:ful_ajax_top>

note that is very important to add the same attributes to the ful_ajax_menu and ful_ajax_gallery tags.

note: This plugin need the scriptacoulus and prototype js libraries loaded in the head of your site template

Tre chicche Javascript/Ajax

inserito in ajax da fullo @ 26-04-2006 11:47

La prima è JQuery, un piccolo script (solo 10Kb) che permette di creare complesse azioni tramite una sorta di linguaggio a cascata. JQuery è inoltre personalizzabile ed è possibile scrivere dei plugin per estenderne le potenzialità.

La seconda è la nuova versione di LightBox, script utile a visualizzare le immagini all'interno di una finestra facendo andare in secondo piano il resto del testo. Questa versione integra (ancora meglio) al suo interno il framework Prototype e gli effetti di Scriptaculous.

Ultima è uno spredsheet chiamato EditGrid, ha al suo interno oltre 135 funzioni di calcolo preimpostate ed alcune template con cui è possibile iniziare a lavorare. Di programmi del genere (perchè ormai si tratta di programmi e non di semplici script) se ne sta parlando ultimamente molto anche su downloadblog.

ciuaz


phpday 2008