Dec 04, 2008, 02:18 PM *
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  
News:Donate to MODx: Donations
Pages: [1]   Go Down
  Print  
Author Topic: [+summary+] deprecated?  (Read 2222 times)
0 Members and 1 Guest are viewing this topic.
Konsum
Member
**
Posts: 74



« on: Mar 10, 2007, 09:45 AM »

I just installed Ditto 2 and now my old Ditto News Template does no more work correctly. The [+summary+] placeholder gives no output.
I read that there is a legacy support for +summary+ in Ditto 2, does that mean there is a newer alternative for it?  Roll Eyes
Logged

Impossible is nothing - with ModX
ZAP
Testers
*
Posts: 1,387



« Reply #1 on: Mar 10, 2007, 10:06 AM »

Yes. You need to add an extender to your snippet call. See http://ditto.modxcms.com/files/assets/snippets/ditto/extenders/summary-extender-inc-php.html

You know I was thinking that it might be a good idea if all snippet developers started dealing with backwards-compatibility the same way. There are a ton of changes between ditto 1 and 2 for example, and it can mean that you need to make a lot of changes to all of your snippet calls if you upgrade. At the same time, as a developer it's a drag to have to be saddled with supporting all past versions when you probably had good reasons for making the changes in the first place.

What if all snippet developers started adding a common parameter (&backwardsCompat=`1`) to all snippets that would when set run a function with a standard name that did all of the variable conversion and whatever else were necessary to make things work the old way. Then developers could keep the vast majority of this code in one standard place (keeping the new code neater), and users who don't need the old methods would not set that parameter. If you had a site with a lot of old snippet calls and you wanted to upgrade them all you could set this parameter in the new snippet itself and that way avoid having to change all of your snippet calls throughout your site).

What do others think of this idea?
Logged

"Things are not what they appear to be; nor are they otherwise." - Buddha

"Well, gee, Buddha - that wasn't very helpful..." - ZAP

Useful MODx links: documentation | wiki  | forum guidelines  | bug reports  | info you should include with your post | commercial support options
Konsum
Member
**
Posts: 74



« Reply #2 on: Mar 10, 2007, 11:33 AM »

To me that sounds like a very good idea!

Right now, I'm just in an test environment so I can play around with the snippet calls. But I want to switch my site to a live environment soon and then snippet updates could become a risky game...

But back to my first post. If +summary+ is deprecated, which other placeholder could I use to get a summary displayed? Or is it still the only way?
« Last Edit: Mar 10, 2007, 11:39 AM by Konsum » Logged

Impossible is nothing - with ModX
ZAP
Testers
*
Posts: 1,387



« Reply #3 on: Mar 10, 2007, 06:47 PM »

Just use the extender parameter explained in the link below and [+summary+] will work the same as before.

Logged

"Things are not what they appear to be; nor are they otherwise." - Buddha

"Well, gee, Buddha - that wasn't very helpful..." - ZAP

Useful MODx links: documentation | wiki  | forum guidelines  | bug reports  | info you should include with your post | commercial support options
Astronut
Jr. Member
*
Posts: 38


« Reply #4 on: Mar 11, 2007, 03:46 AM »

I think what Konsum wants to know is:

Given that this extender is described as "legacy" - does that mean there's another, more appropriate way to show an abbreviated form of the content field?

I'm curious too!
Logged
Mark
Moderator
*
Posts: 3,247


Ditto Developer


WWW
« Reply #5 on: Mar 11, 2007, 04:31 AM »

Yes, use the "Summary (introtext)" field in the manager which is the [+introtext+] placeholder in Ditto. It is far more efficient to only retrieve the introtext compared to retrieving the summary.
Logged

Mark
Moderator
*
Posts: 3,247


Ditto Developer


WWW
« Reply #6 on: Mar 13, 2007, 03:04 PM »

This topic was split for improved forum readability. For the rest of the topic concerning a Ditto upgrade guide see  this thread.
Logged

Pages: [1]   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!