Dec 04, 2008, 01:02 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

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  
Pages: 1 [2] 3 4 ... 7   Go Down
  Print  
Author Topic: Support/Comments for Ditto  (Read 37382 times)
0 Members and 2 Guests are viewing this topic.
openfire3
Jr. Member
*
Posts: 41


benoitdeziel.com


WWW
« Reply #15 on: Jul 13, 2006, 12:11 AM »

Still not working... If i run the updater again can it work?

@mark: Can I PM you an user/pass for the manager to check it out?
Logged

Benoit Déziel
Graphiste & Web Designer
doze
Coding Team
*
Posts: 3,237


....Boom!


« Reply #16 on: Jul 13, 2006, 03:17 AM »

@doze: No, not yet, but I plan on allowing that via a parameter.
Ok, I'll be waiting for that.. I'll try to do some initial snippet with the available fields for now and update it when this is done. Thanks!
Logged

MODxWiki || Please, list wiki worthy material here!
doze
Coding Team
*
Posts: 3,237


....Boom!


« Reply #17 on: Jul 13, 2006, 12:53 PM »

When using JSON as the output format in ditto, is there a way to prevent it breaking the content field into multiple lines? If I use javascript eval() on the output, it errors saying "Unterminated string constant". But if I remove the linebreaks, it gets evaled ok.

So to make it perfectly clear, currently it outputs this (what is not evaling):
Code:
{ "title":"test", "link":"http://localhost:8080/eclipse/modx/index.php?id=39", "description":"", "language":"english", "copyright":"My MODx Site 2006", "copyright":"My MODx Site 2006", "ttl":"120", "entries":[ { "title":"Another title", "link":"http://localhost:8080/eclipse/modx/index.php?id=42", "description":"61.438767,23.730469", "content":"
More content here

", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=42", "author":"Built-in Administration account" }, { "title":"Some title", "link":"http://localhost:8080/eclipse/modx/index.php?id=41", "description":"60.239811,25.048828", "content":"
Content here

", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=41", "author":"Built-in Administration account" } ] }

and when changed to this, it evals ok:
Code:
{ "title":"test", "link":"http://localhost:8080/eclipse/modx/index.php?id=39", "description":"", "language":"english", "copyright":"My MODx Site 2006", "copyright":"My MODx Site 2006", "ttl":"120", "entries":[
{ "title":"Another title", "link":"http://localhost:8080/eclipse/modx/index.php?id=42", "description":"61.438767,23.730469", "content":"More content here", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=42", "author":"Built-in Administration account" },
{ "title":"Some title", "link":"http://localhost:8080/eclipse/modx/index.php?id=41", "description":"60.239811,25.048828", "content":"Content here", "pubDate":"06", "guid":"http://localhost:8080/eclipse/modx/index.php?id=41", "author":"Built-in Administration account" } ] }

The contents of "content" field to json comes from [+summary+] placeholder.

Btw. json is missing from the documentation as possible value to &format parameter..

EDIT: also, is there a reason why copyright is twice at the first block?
« Last Edit: Jul 13, 2006, 12:57 PM by doze » Logged

MODxWiki || Please, list wiki worthy material here!
Marschant
Full Member
***
Posts: 133


« Reply #18 on: Jul 14, 2006, 05:51 AM »

I have a pet hate and that is ListRelated, is there anyway using perhaps the tag parameter to simulate the behaviour of ListRelated using ditto?
I don't want to tag documents at this stage, since I am utilising keywords and metatags and I think this functionality would push ditto beyond the realm of ubercool.

Any ideas?
Logged
doze
Coding Team
*
Posts: 3,237


....Boom!


« Reply #19 on: Jul 14, 2006, 10:20 AM »

Would you consider to allow passing template code right at the snippet call or a path to filesystem.

So when using Ditto in another snippet, I would not need to have ditto's templates allways in chuncks when I want to output in some specific format to my snippet. Could do something like:

$dittoOutput = $modx->runSnippet("Ditto", array("tpl" => "<post><title>[+title+]</title><summary>[+summary+]</summary></post>"));

or

$dittoOutput = $modx->runSnippet("Ditto", array("tpl" => "assets/snippets/mysnippet/dittochunk.tpl"));

So maybe do something like in Ditto when getting the templates from snippet parameters:

Code:
$tpl = isset($tpl) ? $ditto->getTpl($tpl): $_lang['default_template'];

function getTpl($tpl){
global $modx;
$template = "";
if ($modx->getChunk($tpl) != "") {
$template = $modx->getChunk($tpl);
} else if(file_exists($tpl)) {
$template = file_get_contents($tpl);
} else {
$template = $tpl;
}
return $template;
}
Logged

MODxWiki || Please, list wiki worthy material here!
simon79
Jr. Member
*
Posts: 29

I love MODx!


« Reply #20 on: Jul 14, 2006, 11:50 AM »

@openfire:

did you get ditto running?

my modx shows this error:

Quote
I get this error:
Code:

MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
 
PHP error debug
  Error:    Invalid argument supplied for foreach()   
  Error type/ Nr.:    Warning - 2   
  File:    /www/htdocs/fbo/assets/snippets/ditto/ditto.class.inc.php   
  Line:    84   
  Line 84 source:    foreach ($modx->documentMap as $mapEntry) {

seems like we have the same problem!

simon
« Last Edit: Jul 14, 2006, 11:52 AM by simon79 » Logged
Mark
Moderator
*
Posts: 3,247


Ditto Developer


WWW
« Reply #21 on: Jul 14, 2006, 09:17 PM »

Have you applied this fix: http://modxcms.com/forums/index.php/topic,5344.msg40314.html#msg40314
Logged

openfire3
Jr. Member
*
Posts: 41


benoitdeziel.com


WWW
« Reply #22 on: Jul 15, 2006, 02:42 AM »

@simon79:

Yes it's running now but... I reuploaded the install and all the files for 0.9.2.1 and did the udpate again. Now it's working but QuickEdit is rendering weirdly.
Logged

Benoit Déziel
Graphiste & Web Designer
simon79
Jr. Member
*
Posts: 29

I love MODx!


« Reply #23 on: Jul 15, 2006, 05:46 AM »


yes, my ditto is fixed Wink

Quote from: openfire3
Yes it's running now but... I reuploaded the install and all the files for 0.9.2.1 and did the udpate again. Now it's working but QuickEdit is rendering weirdly.

did you upload all files or just teh 0.9.2.1 upgrade like i did?

and i got this error:

Code:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
 
PHP error debug
  Error: Invalid argument supplied for foreach()
  Error type/ Nr.: Warning - 2
  File: /www/htdocs/w00643b4/fbo/assets/snippets/ditto/ditto.class.inc.php
  Line: 84
  Line 84 source: foreach ($modx->documentMap as $mapEntry) {
 
Parser timing
  MySQL: 0.0094 s s (11 Requests)
  PHP: 0.1296 s s
  Total: 0.1390 s s
Logged
openfire3
Jr. Member
*
Posts: 41


benoitdeziel.com


WWW
« Reply #24 on: Jul 15, 2006, 10:45 AM »

@simon79:
Not the patch, I uploaded the whole thing.
Logged

Benoit Déziel
Graphiste & Web Designer
simon79
Jr. Member
*
Posts: 29

I love MODx!


« Reply #25 on: Jul 15, 2006, 12:38 PM »

thx!

i uploaded the 0.9.2.1 files and now its runnig!
Logged
OpenGeek
MODx Co-Founder
Foundation
*
Posts: 5,054


looking a little more like my avatar again...


WWW
« Reply #26 on: Jul 15, 2006, 12:44 PM »

FYI -- the 0.9.2.1 patch is only for users who upgraded to 0.9.2 already, so it would not work if coming from an earlier version.
Logged

Jason Coward
MODx Co-Founder
xPDO Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
The spirit of a warrior is not geared to indulging and complaining, nor is it geared to winning or losing. The spirit of the warrior is geared only to struggle, and every struggle is a warrior's last battle on earth. Thus the outcome matters very little to him. In his last battle on earth a warrior lets his spirit flow free and clear. And as he wages his battle, knowing that his intent is impeccable, a warrior laughs and laughs.
  — don Juan Matus
Mark
Moderator
*
Posts: 3,247


Ditto Developer


WWW
« Reply #27 on: Jul 15, 2006, 01:04 PM »

Ok, I have incorperated the bugfix's in this thread into a quick beta release (attached ONLY to this post).

@Doze, all of your feature requests have been implimented

@Marschant, use the tagging support in ditto as described but use the new tagData source keywords.

* Ditto.zip (48.96 KB - downloaded 317 times.)
Logged

Mark
Moderator
*
Posts: 3,247


Ditto Developer


WWW
« Reply #28 on: Jul 15, 2006, 01:31 PM »

Do you think it would make sense for metatags in the keywords string to be formatted type:value or keep it as just value?
Logged

doze
Coding Team
*
Posts: 3,237


....Boom!


« Reply #29 on: Jul 15, 2006, 07:53 PM »

Ok, I have incorperated the bugfix's in this thread into a quick beta release (attached ONLY to this post).

@Doze, all of your feature requests have been implimented
The JSON data comes now nicely and evals too if there is no html content in it. But if the content field has for example an image, it wont eval, because the " chars wont get escaped. So it will make something like:

Code:
"content":"Test with image:<br /><br /><img width="118" height="74" src="http://www.netguru.fi/modx/assets/images/logo.png" alt="" />"

What ofcourse fails.. Could you do a snippet parameter that when enabled would do addslashes() to all of the fields what will be outputted (title, description, tvs, etc..). Or maybe another parameter to go with that where it would be possible to tell what fields should be addslashed (comma delimitted string, default with all). The it should eval ok..

Logged

MODxWiki || Please, list wiki worthy material here!
Pages: 1 [2] 3 4 ... 7   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!