MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Oct 13, 2008, 02:05 AM
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
:Donate to MODx:
Donations
MODx Community Forums
»
Add-ons, Extensions & Elements
»
Creating & Repurposing Content
»
Ditto
(Moderators:
Mark
,
PaulGregory
)
»
Usage of the &save parameter and [+_ditto_object+]
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: Usage of the &save parameter and [+_ditto_object+] (Read 733 times)
0 Members and 1 Guest are viewing this topic.
The Man Can!
Testers
Posts: 282
Usage of the &save parameter and [+_ditto_object+]
«
on:
May 02, 2008, 03:54 PM »
Is there any additional information on using the save parameter?
I'm trying to use PHx to say, "If Ditto has output, then do this, else do something else", but the [+dittoid_ditto_object+] and [+dittoid_ditto_resource+] placeholders don't seem to return anything, regardless of which save mode I try.
I'm assuming that it's because it's a placeholder for the object itself and not the output of the Ditto call, but is there a way to get Ditto to actually output to a placeholder? I could have sworn there was, but I'm not seeing anything in the code or docs other than the save parameter.
Thanks for any ideas.
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
heliotrope
Coding Team
Posts: 2,412
Re: Usage of the &save parameter and [+_ditto_object+]
«
Reply #1 on:
May 02, 2008, 05:11 PM »
Hi Brett,
you can use the [+total+] placeholder instead.
[+total:isnot=``:then=``+]
:-)
Logged
Made with MODx :
traduction en ligne
|
agence de traduction
|
copadel, fruits et légumes
|
Provence
|
Dictionnaire en ligne
Professional Website:
dixsix, communication interactive
The Man Can!
Testers
Posts: 282
Re: Usage of the &save parameter and [+_ditto_object+]
«
Reply #2 on:
May 02, 2008, 05:40 PM »
Thanks for the response, Heliotrope. I wouldn't have thought of that. In case anybody else needs this, keep in mind you'll need to add &paginate=`1` and &paginateAlwaysShowLinks=`1` to your ditto call to get the [+total+] to show up.
So that takes care of the bigger issue, but as far as the actual Ditto output going to a placeholder, is that possible? Without some way to output to a placeholder I'd need to duplicate the Ditto call, which isn't the end of the world, but I'd rather not if it's avoidable.
Code:
[[Ditto? &parents=`39` &tpl=`event_link_mini` &display=`100` &id=`seminars` &sortBy=`date_start` &sortDir=`ASC` ]]
[+phx:if=`[+seminars_total+]`:ne=``:then=`
<div class="container">
<h2 class="h1">Seminars</h2>
[+seminars_ditto_object+] <!-- Ditto call would have to be duplicated here -->
</div>
`+]
EDIT:
Yeah, outputting to a placeholder is definitely gonna be useful, or the first ditto call (that generates the +total+ placeholder, needs to have its output hidden with CSS or commented out or something...
EDIT 2:
I know this could be accomplished with a format config file, but I'd rather avoid that for a few reasons.
«
Last Edit: May 02, 2008, 05:52 PM by The Man Can!
»
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
Jesse R.
Coding Team
Posts: 775
Re: Usage of the &save parameter and [+_ditto_object+]
«
Reply #3 on:
May 02, 2008, 07:45 PM »
I do not believe you can make use of those placeholders unless you set &save to something besides its default value of 0. For instance:
Code:
[[Ditto? &parents=`39` &tpl=`event_link_mini` &display=`100` &id=`seminars` &sortBy=`date_start` &sortDir=`ASC` &save=`1`]]
You can find more information here:
http://ditto.modxcms.com/files/snippet-ditto-php.html#save
«
Last Edit: May 02, 2008, 07:50 PM by Jesse R.
»
Logged
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now.
Every contribution helps.
The Man Can!
Testers
Posts: 282
Re: Usage of the &save parameter and [+_ditto_object+]
«
Reply #4 on:
May 02, 2008, 08:04 PM »
Right, but regardless the value (1, 2, 3) the placeholders don't generate anything. At least, not for me.
The code I pasted above was the workaround, since I can't get &save to actually do anything (except not output anything).
The Ditto code actually replaces [+ _ditto_object+] with $ditto itself, the entire Ditto object, not the output, so I think that's why it's not replacing the placeholder with the output (unless I'm missing something about the makeup of the $ditto object itself).
At this point I've worked around the issue with the [+total+] idea and commenting out the first Ditto call's output, but I'm still kind of curious if it's possible.
Logged
Need
MODx Ecommerce?
Try
FoxyCart!
Jesse R.
Coding Team
Posts: 775
Re: Usage of the &save parameter and [+_ditto_object+]
«
Reply #5 on:
May 02, 2008, 09:30 PM »
It would have probably helped if I reread your original post after looking at ditto and seeing that you quite clearly were talking about what I mentioned
. Now let's see if I can be of a little help. I do not think Ditto places its output in a placeholder. However, have you considered coding your own snippet to do exactly what you are looking to do? Something like this:
Code:
<?php
$dittoParams
= array(
'parents'
=>
'39'
,
'tpl'
=>
'event_link_mini'
,
'display'
=>
'100'
,
'sortBy'
=>
'date_start'
,
'sortDir'
=>
'ASC'
,
'id'
=>
'seminars'
);
$dittoOutput
=
$modx
->
runSnippet
(
'Ditto'
,
$dittoParams
);
if (
$dittoOutput
!=
''
) {
return
THIS
;
} else {
return
THIS
;
}
?>
«
Last Edit: May 02, 2008, 10:06 PM by Jesse R.
»
Logged
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now.
Every contribution helps.
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.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
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & 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
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Web Design and Development
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
Czech Community
-----------------------------
=> Oznámení
===> Důležitá oznámení/novinky
===> Bezpečnost
=> 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)
=> Komunita
===> Oznámení
===> Představte se, prosím
===> Ukázky práce
===> Různé aneb cokoli co se jinam nehodí
-----------------------------
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ışı