MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Aug 08, 2008, 01:35 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
modxcms.com
web
MODxCMS.com
Forums
Help
Login
Register
News
:Read
Frequently Asked Questions (FAQ)
MODx Community Forums
»
Add-ons, Extensions & Elements
»
Creating & Repurposing Content
»
Ditto
(Moderators:
Mark
,
PaulGregory
)
»
[Tutorial] Results Per Page Form Dropdown
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: [Tutorial] Results Per Page Form Dropdown (Read 9599 times)
0 Members and 1 Guest are viewing this topic.
Soda
Testers
Posts: 415
Daddy !
[Tutorial] Results Per Page Form Dropdown
«
on:
Mar 18, 2007, 12:33 AM »
New version by Mark
http://modxcms.com/Results-Per-Page-1574.html
Thanks Mark to allow doing this so easy !
This small tips allow the user to select how many result are displayed on the page.
It can be modified to add other choice, date asc, desc ...
First:
you must call Ditto with the parameter : &extenders=`request`
Two:
add this small snippet and call it just before your ditto call
Note: Requires Ditto 2
Use this code as you want.
Edit (Mark) : There is a new version available
here
that supports Ditto's &id parameter. The previous version by Soda is still available below.
Code:
<?php
$choix_res_per_page
=array(
0
,
1
,
2
,
3
,
4
,
5
,
6
,
10
);
// Enter the differents choice you would allow
$default_value
=
3
;
// The default choice value
$label_choice
=
'Results per page:'
;
// The label for the field
$go
=
'Go'
;
//label for the form's button
$nbres
=(isset (
$_GET
[
'ditto_summarize'
]))?
$_GET
[
'ditto_summarize'
] :
$default_value
;
echo <<<END
<form method="get">
<label for="nbres">$label_choice</label>
<select name="ditto_summarize" id="ditto_summarize">
END;
foreach (
$choix_res_per_page
as
$value
){
$selectedres
=(
$value
==
$nbres
)?
' selected="selected"'
:
''
;
echo
" <option value=\"$value\"$selectedres>$value</option>\n"
;
}
echo
"</select>"
;
echo <<<END
<input class="boutton" value="$go" type="submit"></p>
</form>
END;
?>
Example call:
[!ResPerPage!]
[!Ditto? &parent=`29` &extenders=`request` paginate=`1`!]
«
Last Edit: Aug 22, 2007, 08:13 AM by Soda
»
Logged
MODx Sites & Prestations:
http://dp-site.fr
[
Last MODx Site
]
MODx Repository: [
HOME
] [
MetaTagsExtra
] / Current Dev: [xFDM]
rthrash
Foundation
Posts: 9,032
Re: [TUTORIAL] Results Per Page Form Dropdown
«
Reply #1 on:
Mar 18, 2007, 08:51 AM »
Very cool tip.
Logged
MODx
is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you
help us help you
,
read the wiki
, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @
Collabpad
work
productively.
work
intelligently.
work
together.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (097 Wiki)
|
Fisheye SVN Browser
zi
MODx Special Forces /
Administrator
Posts: 2,903
May Peace Be On You
Re: [Tutorial] Results Per Page Form Dropdown
«
Reply #2 on:
Apr 17, 2007, 01:43 PM »
Awesome contribution man!
Thanks a ton.
regards.
Logged
Subscribe to
MODx Commercial Support Plans
“Internet Explorer’s CSS rendering: WYSIWTF”. — someone genius
--------------------------------------------------
MODx Docs
MODx Wiki
Bug Tracker
Download Center
Donations
Forum Rules
ziDesigns
ziDesigns Resources
ziworks | Custom/Free MODx Templates
davidm
Marketing & Design Team
Posts: 6,526
The best way to predict the future is to invent it
Re: [Tutorial] Results Per Page Form Dropdown
«
Reply #3 on:
May 03, 2007, 04:19 AM »
I had missed that one, Nice one David
!
Logged
blog.nodeo.net
:
Pour un web libre, moderne et ouvert!
:: |
! Nouveau !
Les forums modxcms.fr
:
Participez à l'élaboration du site MODx francophone !
! Nouveau !
:.
MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.
Config :
Apache 2.2.8 - MySQL 5.0.45 - PHP 5.2.5 | Debian 4.0 (Etch)
Réalisations sous MODx :
nodeo.net
|
gican.asso.fr
|
michelez-notaires.com
|
amadom.gerondicap.com
|
sworld.com
|
soleil.info
et 3 autres en cours de réalisation
Mark
Moderator
Posts: 3,247
Ditto Developer
Re: [Tutorial] Results Per Page Form Dropdown
«
Reply #4 on:
Jul 30, 2007, 05:18 PM »
Here is a new version that supports Ditto's &id parameter. Also, the variable names have been changed to their English equivalents.
http://modxcms.com/Results-Per-Page-1574.html
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
labasus
Jr. Member
Posts: 34
Re: [Tutorial] Results Per Page Form Dropdown
«
Reply #5 on:
May 25, 2008, 01:48 PM »
Hello,
very useful snippet, but it could be more useful without "go" button.
It must be smth. like that ->
Quote
// place this javascript code just before the </head> tag
function doSel(obj)
{
for (i = 1; i < obj.length; i++)
if (obj
.selected == true)
eval(obj
.value);
}
<!-- this HTML code goes between your <body> tags -->
<form name="jsMenu">
<select name="jsSelList" size="1" onchange="doSel(this)">
<option selected value>Select a page, and Gone!</option>
<option value="location.href='dHTML1.html'">Dynamic HTML 1</option>
<option value="location.href='validForm.html'">Validating Form 1</option>
<option value="location.href='../index.html'">GrassBlade Home Page</option>
<option value="location.href='validSSN.html'">Validating SSN</option>
<option value="location.href='selSwitch.html'">Multiple Select Swap</option>
</select>
</form>
Maybe somebody can do it in php?
Logged
Pages: [
1
]
Go Up
Print
« Previous topic
Next topic »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Important News
=> Security Notices
-----------------------------
Commercial Support
-----------------------------
=> [CS] About Commercial Support
-----------------------------
Development & Coding
-----------------------------
=> Commercial Inquiries & Bounties
=> Core Code
===> MODx Next
===> xPDO
=> Module, Plugin & Snippet Creation and Modification
=> In Development
=> Templates
=> Internationalization
===> Bulgarian
===> Chinese
===> Czech
===> Dutch
===> French
===> German
===> Irish
===> Italian
===> Japanese
===> Polish
===> Portuguese
===> Russian
===> Slovak
===> Spanish
===> Swedish
===> Persian - فارسي
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.1
===> 0.9.6
===> 0.9.5 and earlier
=> General Support
===> MODx 101
===> E-Commerce, E-Marketing, Analytics & SEO
===> Hosting Experiences
===> IIS / Windows Hosting Issues
=> Documentation, Tips & Tricks
===> Documentation Suggestions & Corrections
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder (and DropMenu)
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> QuickEdit
=> Users, Authentication & Personalization
===> WebloginPE
===> WebLogin, WebSignup and WebChangePwd
=> Rich Text Editors & File Browser
===> TinyMCE
===> FCKeditor
===> MCPuck File Browser
=> Forms, Form Processing & Anti-Spam
===> eForm
=> Search
===> AjaxSearch
=> E-business
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> PHx
=> Templates
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Web Design and Development
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
Bulgarian Community
-----------------------------
=> Поддръжка
===> Често задавани въпроси
===> Инсталация
===> Модули, Плъгини, Снипети и код
===> Дизайн и Шаблони
=> Документация, Ръководства и Превод
===> Документация
===> Ръководства
===> Превод
=> Общество
===> Съобщения
===> Представете се
===> Представете сайта си
===> Дискусии извън MODx
-----------------------------
Dutch Community
-----------------------------
=> Ondersteuning
===> Veel gestelde vragen
===> Modules, Plugins, Snippets & Code
===> Design & Templates
=> Documentatie, Tutorials en Vertalingen
===> Documentatie
===> Tutorials
===> Vertalingen
=> Community
===> Aankondigingen
===> Stel jezelf voor
===> Site Showcase
===> De stamkroeg
-----------------------------
Finnish Community
-----------------------------
=> Tuki
===> UKK
===> Asennus
===> Moduulit, liitännäiset, koodinpätkät
===> Ulkoasu/Sivustopohjat
=> Dokumentaatio, oppaat ja käännökset
===> Dokumentaatio
===> Käännökset
===> Oppaat
=> Yhteisö
===> Tiedotteet
===> Esittele itsesi
===> MODx sivustosi
===> Kahvihuone
-----------------------------
Filipino Community
-----------------------------
=> Suporta
===> Kadalasang tanong
===> Instalasyon
===> Moduler, Maidadagdag, Karagdagang mga Code
===> Desenyo at Templates
=> Dokumentasyon, Mga Turo, Mga Salin
===> Dokumentasyon
===> Mga Turo
===> Mga Salin
=> Kumunidad
===> Anunsyo
===> Ipakilala ang sarili
===> Ang Galing ng pinoy
===> Tsismisan atbp
-----------------------------
French Community
-----------------------------
=> Support
===> FAQ
===> Installation
===> Module, plugin, snippets
===> Design/Templates
=> Documentation, Tutoriels et Traductions
===> Documentation
===> Traduction
===> Tutoriels
=> Communauté
===> Annonces
===> Présentez vous
===> Vos sites
===> Le Bistrot Français
-----------------------------
German Community
-----------------------------
=> Support (de)
===> FAQ (de)
===> Installation (de)
===> Module, Plugins, Snippets & Code (de)
===> Design & Templates (de)
=> Dokumentation, Tutorials und Übersetzung
===> Dokumentation
===> Tutorials (de)
===> Übersetzung
=> Community (de)
===> Ankündigungen
===> Stellt Euch vor
===> Beispielseiten
===> Off Topic / Verschiedenes
-----------------------------
Irish Community
-----------------------------
=> Tacaíocht
===> CC Ceisteanna Coitianta
===> Breiseáin (cláir bhreise), Snippets & Comhaid
===> Suiteáil
===> Dearadh & Teimpléid
=> Doiciméid, Teagascóireacht agus Aistriúchán
===> Doiciméadú
===> Teagascóireacht
===> Aistriúchán
=> Pobal
===> Fógraí
===> Cuir Tú Féin in Aithne
===> Gailearaí an Láithreáin
===> Caifé / An Tábhairne / Ábhar Cainte Eile / Ilghnéitheach
-----------------------------
Italian Community
-----------------------------
=> Supporto
===> FAQ
===> Installazione
===> Moduli, Plugin, Snippet e altro codice
===> Web Design e Template
=> Documentazione, Tutorial e Traduzione
===> Documentazione
===> Tutorial
===> Traduzione
=> Comunità
===> Annunci
===> Presentazioni
===> Siti in vetrina
===> Chiacchiere in libertà
-----------------------------
Japanese Community
-----------------------------
=> サポート
===> 良くある質問
===> インストール
===> モジュール・プラグイン・スニペット・本体
===> デザインやテンプレート
=> マニュアル・テュートリアル・翻訳
===> マニュアル
===> 事例集、テュートリアル
===> 日本語化
=> コミュニティ
===> お知らせ
===> MODxサイト展示場
===> 自己紹介
===> 雑談
===> 国産リソース
-----------------------------
Persian Community
-----------------------------
=> پشتيباني
===> راهنما
===> نصب
===> ماژول , پلاگین ها , کد ها و جزییات
===> طراحی و قالب ها
=> مستند سازی , آموزش ها و ترجمه ها
===> مستند سازی
===> آموزش ها
===> ترجمه ها
=> انجمن ها
===> اخبار
===> معرفی کردن خود
===> نمایش دادن سایت ها
===> بحث های عمومی و سایر موضوعات
-----------------------------
Polish Community
-----------------------------
=> Wsparcie
===> FAQ
===> Instalacja
===> Moduły, pluginy, snipety i kod
===> Wygląd i szablony
=> Dokumentacja, tutoriale i tłumaczenie
===> Dokumentacja
===> Tutoriale
===> Tłumaczenie
=> Społeczność
===> Ogłoszenia
===> Przedstaw się
===> Twój serwis WWW
===> Hyde Park
-----------------------------
Portuguese Community
-----------------------------
=> Suporte
===> FAQ - Dúvidas Frequentes
===> Instalação
===> Módulos, Plugins, Snippets e Código
===> Design e Templates
=> Documentação, Guias e Traduções
===> Documentação
===> Guias
===> Traduções
=> Comunidade
===> Anúncios
===> Apresente-se!
===> Bar da esquina (fora de tópico)
===> Portfólio de Sites
-----------------------------
Russian Community
-----------------------------
=> Поддержка
===> ЧАВО (FAQ)
===> Установка
===> Модули, плагины, сниппеты и код
===> Дизайны и шаблоны
=> Документация, Уроки, Перевод
===> Документация
===> Уроки
===> Перевод
=> Сообщество
===> Объявления
===> Представьтесь публике
===> Галерея сайтов
===> Диван
-----------------------------
Scandinavian Community
-----------------------------
=> Support
===> Frågor och svar
===> Installation
===> Moduler, plugins, snippets och kod
===> Design & sidmallar
=> Dokumentation, guider och översättningar
===> Dokumentation
===> Guider
===> Översättningar
=> Webbgemenskap
===> Meddelanden
===> Presentera dig själv
===> Visa upp dina webbsidor
===> Ordet fritt
-----------------------------
Spanish Community
-----------------------------
=> Soporte
===> FAQ
===> Instalación
===> Modulos, Plugins, Snippets & Código
===> Diseño y plantillas
=> Documentación, Tutoriales y Traducciones
===> Documentatción
===> Tutoriales
===> Traducciones
=> Comunidad
===> Anuncios
===> Presentaciones personales
===> Muestra de sitios
===> El Café
-----------------------------
TÜRKÇE (Turkish)
-----------------------------
=> Destek
===> SSS
===> Kurulum
===> Modüller, Pluginler, Snippetlar & Kodlar
===> Dizayn & Temalar
=> Belgeleme, Eğitmenler ve Çeviri
===> Belgeleme
===> Eğitmenler
===> Çeviri
=> Topluluk
===> Duyurular
===> Kendinizi Tanıtın
===> Site Vitrini
===> Konu Dışı