Lasso Soft Inc. > Home

[ul_taxonomy]

Linkul_taxonomy
AuthorBrian Loomis
CategoryOutput
Version8.x
LicensePublic Domain
Posted27 Jun 2008
Updated28 Jun 2008
More by this author...

Description

This tag is used to return an unordered list based off of the xs_cat tags so that css flyout menus, or javascript jQuery madness can be applied for ultimate styling and sliding pleasure. http://www.cssplay.co.uk/menus/ See Stuart Nichols stuff. Once you get this tag implemented with xs_cat you will see how easy it is to optimize dynamic css menus from your database content. You can also modify the SQL generation easily enough to show only subnodes etc.

Sample Usage

');
var('gv_error'='');
var('comp_sql'='');
!(lasso_tagexists: 'xs_cat') ?
library:'/components/inSite/category_ctags.inc';
var(
		'cattable_resources'='pages',

		);



define_tag(
	'taxonomy',
	-namespace='ul_',
	-req='css_id',  -type='string',
	-req='recurse', -type='integer',
	-priority='replace',
	-description='Returns nested unordered lists of elements of a taxonomy within the given path.'
);
local('out')='';
var('SQL'	=	xs_cat->(fullCatSQL(-cattable= $cattable_resources ,-xtraReturn=', node.lft, node.rgt, node.description, node.metatags, node.metadescription, node.title_tag ',-xtraWhere='', -depth=#recurse)));
				
				inline(-username='xxx',-password='yyy', -database='zzz',,-SQL=$SQL, -maxrecords='500');
				var('depth'= integer(column('depth')));
					var('c_depth'= integer(column('depth')));
				#out += '
    \n' ('\t' * ($depth )) records; var('c_depth'= integer(column('depth'))); if: integer(column('depth'))==$depth;; #out += ('\t' * ($depth + 1)) '
  • ' column('title') '
  • \n'; else: integer(column('depth'))>$depth; #out += ('\t' * ($depth + 1)) '
      \n' ('\t' * ($depth + 2)) '
    • ' column('title') '
    • \n'; else: integer(column('depth')) < $depth; #out += ('\t' * ($depth )) ('
    \n' * ($depth )) '
\n
    \n' ('\t' * ($depth )) '
  • ' column('title') '
  • \n'; else; /if; var('depth'= integer(column('depth'))); /records; #out += '
      \n'; /inline; return: #out; /define_tag; encode_smart:(ul_taxonomy: -recurse=2, -css_id='calendar'); ?> gets you:
      • Databases
        • PostGreSQL
        • MySQL
        • FileMaker

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag(
	'taxonomy',
	-namespace='ul_',
	-req='css_id',  -type='string',
	-req='recurse', -type='integer',
	-priority='replace',
	-description='Returns nested unordered lists of elements of a taxonomy within the given path.'
);
local('out')='';
var:'cattable_resources' = 'pages'; //name of your taxonomy database
var('SQL'	=	xs_cat->(fullCatSQL(-cattable= $cattable_resources ,-xtraReturn=', node.lft, node.rgt, node.description, node.metatags, node.metadescription, node.title_tag ',-xtraWhere='', -depth=#recurse)));
				
				inline(-username='xxx',-password='yyy', -database='zzz',-SQL=$SQL, -maxrecords='500');
				var('depth'= integer(column('depth')));
					var('c_depth'= integer(column('depth')));
				#out += '
    \n' ('\t' * ($depth )) ;//'
  • ' column('title') '
  • \n'; records; var('c_depth'= integer(column('depth'))); if: integer(column('depth'))==$depth;; #out += ('\t' * ($depth + 1)) '
  • ' column('title') '
  • \n'; else: integer(column('depth'))>$depth; #out += ('\t' * ($depth + 1)) '
      \n' ('\t' * ($depth + 2)) '
    • ' column('title') '
    • \n'; else: integer(column('depth')) < $depth; #out += ('\t' * ($depth )) ('
    \n' * ($depth )) '
\n
    \n' ('\t' * ($depth )) '
  • ' column('title') '
  • \n'; else; /if; var('depth'= integer(column('depth'))); /records; #out += '
      \n'; /inline; return: #out; /define_tag;

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft