Editing
Keywords
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Displaying keyword lists within listings pages=== * LITTLED/JQuery config within <code>$(document).ready()</code> :<syntaxhighlight lang="javascript"> $fn.keywords('bindListingsHandlers'); </syntaxhighlight> :* This is ''not'' rolled into <code>$fn.listings('bindListingsHandlers')</code> :* Typically, it would be added to a JQuery plugin targeted to a specific CMS content section: <syntaxhighlight lang="javascript" highlight="14,19"> /* * file: content_type.js * JQuery added functionality */ (function($) { var methods = { bindListingsHandlers: function() { return this.each(function() { /* listings handlers */ $(this) .listings('bindListingsHandlers') .keywords('bindListingsHandlers'); LITTLED.init({setSortables: function() { $('#listings-container') .listings('bindListingsButtons') .keywords('bindListingsButtons'); }}); }); }, /* etc... */ </syntaxhighlight> * Outside the listings loop, :* Define an object to use to retrieve and display keyword lists. :* Set the keyword object's content id to the appropriate value for the listings content. * Within the listings loop, :* Set the id of the keyword object to the current record id. :* Include shared content include to display keyword list. :* Clear keyword values. <syntaxhighlight lang="php" highlight="1,7-9"> $keywords = new db_keyword_content_class($filters->site_section->id->value); while ($row = mysql_fetch_object($rs)) { ?> <tr class="rec-row <?=$rowClass?>" id="rr-<?$filters->site_section->id->value?>-<?=$row->id?>" data-rid="<?=$row->id?>"> <td> <? $keywords->id->value = $row->id; include (COMMON_TEMPLATE_DIR."content/keywords/keywords_cell.php"); $keywords->clear_keyword_data(); ?> </td> </tr> } </syntaxhighlight>
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information