MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Jul 05, 2009, 01:37 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
Search via SMF
or Google:
modx forums
all of 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
(Moderator:
Mark
)
»
Pagination - how to limit # of visible links?
Pages: [
1
]
2
Go Down
« Previous topic
Next topic »
Print
Author
Topic: Pagination - how to limit # of visible links? (Read 17330 times)
0 Members and 1 Guest are viewing this topic.
Errant
Jr. Member
Posts: 18
Pagination - how to limit # of visible links?
«
on:
Apr 15, 2007, 11:12 AM »
Hi all. Straight to the question - can such kind of pagination be made with Ditto:
[1][2][3][4][5] ... [34][35][36]
?
I mean, links in between are hidden and shown only then your're on pages near to them. By default, all pages are shown. Solutions like limiting # of pages (&total) or creating an archive not good for me.
Logged
"Sorry for my english"
Mark
Moderator
Posts: 3,250
Ditto Developer
Re: Pagination - how to limit # of visible links?
«
Reply #1 on:
Apr 15, 2007, 03:08 PM »
Yes, with a snippet like
this
«
Last Edit: May 06, 2007, 07:00 PM by Mark
»
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
Errant
Jr. Member
Posts: 18
Re: Pagination - how to limit # of visible links?
«
Reply #2 on:
Apr 16, 2007, 10:15 AM »
This snippet outputs links even better than I wanted to =) Thank you Mark!
There was a little trouble with making snippet work - links wasn't splitted with such call:
[[Ditto? &summarize=`3` &total=`77` &parents=`61,64,66,67,47` &depth=`5` &hideFolders=`1` &tpl=`np` &tplAlt=`npalt` &tplFirst=`npfirst` &paginateAlwaysShowLinks=`1` &extenders=`summary` &truncLen=`500` &truncOffset=`100` &truncText=`Читать далее...` &paginate=`1` &dateFormat=`%B %d %Y, %H:%M` &tplTrunc=`ditto_readmore` &hiddenFields=`news_source`]]
[[splitPagination]]
Cached and uncached, different settings for total and summarize were used. So I've change [+pages+] to [[splitPagination]] in my template, and modify last snippet string: "if ($return) return $ph;" to just "return $ph;".
Maybe it's not a correct way and i'm missing smth, but it working and me is happy :]
Logged
"Sorry for my english"
Mark
Moderator
Posts: 3,250
Ditto Developer
Re: Pagination - how to limit # of visible links?
«
Reply #3 on:
Apr 16, 2007, 10:21 AM »
The snippet above sets [+splitPages+] for you to use instead of [+pages+]. If you call it with &return=`1` it will return the value back to you instead of placing the output in a placeholder. Remember, never call pagination calls cached unless the page is uncached.
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
Errant
Jr. Member
Posts: 18
Re: Pagination - how to limit # of visible links?
«
Reply #4 on:
Apr 16, 2007, 02:17 PM »
Thanks for clearing things. I think this snippet could be listed in repository or embedded in ditto.
Logged
"Sorry for my english"
gcruz
Full Member
Posts: 101
Re: Pagination - how to limit # of visible links?
«
Reply #5 on:
Apr 16, 2007, 03:43 PM »
So will it read the splitter marker and make pages?
Can I show section names instead of pages?
Thanks,
Gary
[Edit] Removed quote for readability
«
Last Edit: Apr 16, 2007, 07:33 PM by Mark
»
Logged
Mark
Moderator
Posts: 3,250
Ditto Developer
Re: Pagination - how to limit # of visible links?
«
Reply #6 on:
Apr 16, 2007, 07:37 PM »
This snippet is just a different version of [+pages+]. What do you mean by show section names?
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
gcruz
Full Member
Posts: 101
Re: Pagination - how to limit # of visible links?
«
Reply #7 on:
Apr 18, 2007, 01:05 AM »
Quote from: Mark on Apr 16, 2007, 07:37 PM
This snippet is just a different version of [+pages+]. What do you mean by show section names?
Typically, I would have multiple documents in a folder, and use wayfinder or ditto to generate pages.
Section name would be the title of the page.
But let's say there is
one
document that I want to split up.
Each page would be called by the section where I would put the split.
In this case, it would have to be the h3 or whatever header I put.
Hope that made sense.
Logged
gl330k
Member
Posts: 75
Re: Pagination - how to limit # of visible links?
«
Reply #8 on:
Jul 20, 2007, 01:42 PM »
Ok. I'm not understanding the execution of this snippet. Can someone help me. I have the following in a document
[!Ditto? &parents=`46` &summarize=`10` &total=`20` &commentsChunk=`blog_CommentsBlog` &tpl=`blog_BlogTemplate` &dateSource=`pub_date` &dateFormat=`%m-%d-%Y` &sortBy=`pub_date` &paginate=`1` &paginateAlwaysShowLinks=`1` !]
[!splitPagination!]
I'm expecting a 2 page notification at the end of a list of 10 entries but it's doing nothing. What am I doing wrong?
Thanks,
gl330k
Logged
yentsun
MODx Russia
Committed to MODx
Posts: 518
Re: Pagination - how to limit # of visible links?
«
Reply #9 on:
Feb 01, 2008, 04:42 AM »
I have about 4000 docs to output with Ditto, so this snippet is the only way I can do pagination with (the usual [+pages+] simply won't fit into screen). But splitPagination behave somewhat strange... it adds an extra page at start ([1][1][2][3]...) and the active page won't turn into <span>, so we do not see the active page actually. Here is the page with my case:
http://s31183.gridserver.com/news
Please help me with that... its kind of crucial for me
Thanks in advance.
«
Last Edit: Feb 01, 2008, 05:19 AM by yentsun
»
Logged
http://modx.ru
- российская поддержка MODx
http://modxnotes.blogspot.com/
- личный блог по MODx
http://yentsun.com
- персональный сайт
Mark
Moderator
Posts: 3,250
Ditto Developer
Re: Pagination - how to limit # of visible links?
«
Reply #10 on:
Feb 01, 2008, 07:56 PM »
Could you provide the Ditto and splitPagination calls you are using?
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
yentsun
MODx Russia
Committed to MODx
Posts: 518
Re: Pagination - how to limit # of visible links?
«
Reply #11 on:
Feb 13, 2008, 03:14 AM »
I'm so sorry Mark! Forgot to provide the call... here it is
Code:
[[Ditto? &tpl=`news_item_ext` &summarize=`22` &paginate=`1` &extenders=`request,dateFilter,cal_dateFilter` &dateSource=`createdon` &depth=`2` &hideFolders=`1` &tagData=`tags` &tagSort=`0` &tagDelimiter=`, ` &tagDisplayDelimiter=` ` &seeThruUnpub=`0` &filter=`isnews,1,2`]]
<div class="pages">
[[splitPagination? &return=`1`]]
</div>
The page is uncached ofcourse.
Logged
http://modx.ru
- российская поддержка MODx
http://modxnotes.blogspot.com/
- личный блог по MODx
http://yentsun.com
- персональный сайт
Mark
Moderator
Posts: 3,250
Ditto Developer
Re: Pagination - how to limit # of visible links?
«
Reply #12 on:
Feb 13, 2008, 06:18 PM »
I would try setting the same Ditto ID on both the Ditto call itself and the splitPagination snippet.
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
yentsun
MODx Russia
Committed to MODx
Posts: 518
Re: Pagination - how to limit # of visible links?
«
Reply #13 on:
Feb 15, 2008, 02:52 AM »
Mark, I've added ids to both Ditto and splitPagination calls like this:
Code:
[[Ditto? &tpl=`news_item_ext` &summarize=`22` &paginate=`1` &extenders=`request,dateFilter,cal_dateFilter` &dateSource=`createdon` &depth=`2` &hideFolders=`1` &tagData=`tags` &tagSort=`0` &tagDelimiter=`, ` &tagDisplayDelimiter=` ` &seeThruUnpub=`0` &filter=`isnews,1,2` &id=`main`]]
<div class="pages">
[[splitPagination? &return=`1` &id=`main`]]
</div>
And it didn't help
Logged
http://modx.ru
- российская поддержка MODx
http://modxnotes.blogspot.com/
- личный блог по MODx
http://yentsun.com
- персональный сайт
Mark
Moderator
Posts: 3,250
Ditto Developer
Re: Pagination - how to limit # of visible links?
«
Reply #14 on:
Feb 16, 2008, 11:30 PM »
Try setting both calls to uncached, even if it is on an uncached page. Also, try removing all the Ditto parameters and if it works, add them back in one at a time until it breaks.
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
Pages: [
1
]
2
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
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & DropMenu
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> Front-end Document Management
=> 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
=> Polls, Calendars, Address Book and Community
=> Third-party integrations
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> Backup & Versioning
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.3
===> 0.9.6.2
===> 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
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Webworker Lounge
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
International Support & Translations
-----------------------------
=> Internationalization
=> Bulgarian
===> Поддръжка
=====> Често задавани въпроси
=====> Инсталация
=====> Модули, Плъгини, Снипети и код
=====> Дизайн и Шаблони
===> Документация, Ръководства и Превод
=====> Документация
=====> Ръководства
=====> Превод
===> Общество
=====> Съобщения
=====> Представете се
=====> Представете сайта си
=====> Дискусии извън MODx
=> Chinese
=> Czech
===> Oznámení
=====> Důleitá oznámení/novinky
=====> Bezpečnost
===> Komunita
=====> Oznámení
=====> Představte se, prosím
=====> Ukázky práce
=====> Různé aneb cokoli co se jinam nehodí
===> Podpora
=====> FAQ (často kladené otázky)
=====> Instalace
=====> Moduly, pluginy, "snippets & code" (ablony zdrojových kódů)
=====> Design & ablony
===> Dokumentace, tutoriály (návody) a překlady
=====> Dokumentace
=====> Tutoriály (návody)
=====> Překlady (lokalizace)
=> Dutch
===> 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
=> Filipino
===> 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
=> Finnish
===> 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
=> French
===> 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
===> 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
=> Hebrew
===> הכרזה
=====> חדשות חשובות
=====> אבטחה
===> תמיכה
=====> התקנה
=====> תיעוד, מדריכים ותרגומים
=====> עיצוב ותבניות
=====> שאלות נפוצות
===> תיעוד, מדריכים ותרגומים
=====> תיעוד
=====> מדריכים
=====> תרגומים
===> קהילה
=====> הודעות
=====> הצג את עצמך
=====> אתרים לדוגמא
=====> כללי
=> Irish
=> Italian
===> 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
===> サポート
=====> 良くある質問
=====> インストール
=====> モジュール・プラグイン・スニペット・本体
=====> デザインやテンプレート
===> マニュアル・テュートリアル・翻訳
=====> マニュアル
=====> 事例集、テュートリアル
=====> 日本語化
===> コミュニティ
=====> お知らせ
=====> MODxサイト展示場
=====> 自己紹介
=====> 雑談
=====> 国産リソース
=> Persian - فارسي
===> پشتيباني
=====> راهنما
=====> نصب
=====> ماژول , پلاگین ها , کد ها و جزییات
=====> طراحی و قالب ها
===> مستند سازی , آموزش ها و ترجمه ها
=====> مستند سازی
=====> آموزش ها
=====> ترجمه ها
===> انجمن ها
=====> اخبار
=====> معرفی کردن خود
=====> نمایش دادن سایت ها
=====> بحث های عمومی و سایر موضوعات
=> Polish
===> 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
===> 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
===> Поддержка
=====> ЧАВО (FAQ)
=====> Установка
=====> Модули, плагины, сниппеты и код
=====> Дизайны и шаблоны
===> Документация, Уроки, Перевод
=====> Документация
=====> Уроки
=====> Перевод
===> Сообщество
=====> Объявления
=====> Представьтесь публике
=====> Галерея сайтов
=====> Диван
=> Scandanavian
===> 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
=> Slovak
=> Spanish
===> 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é
=> Swedish
=> 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ışı