Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • International
  • Polish
  •  
  • wczytanie zawartości [+content+] z innego dokumentu#

  • 3776
    6

    bodzio Reply #1, 1 year, 11 months ago

    Reply
    • Link to this post#1
    Witam

    jak mogę wgrać zawartość dokumentu [+content+] o znanym mi nr id do innego dokumentu np. pomiędzy ?

    Pozdrawiam
    Krzysiek


  • 9757
    82

    fixedmachine Reply #2, 1 year, 11 months ago

    Reply
    • Link to this post#2
    Najprościej użyć tego snippeta:
    http://modxcms.com/extras/package/173

    Możesz pobierać dowolne dane z dowolnego dokumentu o znanym ID.


  • 3776
    6

    bodzio Reply #3, 1 year, 11 months ago

    Reply
    • Link to this post#3
    fajnie by było, ale jak wpisuje:
    [[GetField? &docid=`316` &parent=`0` ]]
    to otrzymuje tylko tytuł strony a nie treść


  • 3776
    6

    bodzio Reply #4, 1 year, 11 months ago

    Reply
    • Link to this post#4
    w międzyczasie znalazłem inne rozwiązanie:
    [[YAMS? &get=`data` &from=`content` &docid=`316` ]]
    i to mi działa !


  • 9757
    82

    fixedmachine Reply #5, 1 year, 11 months ago

    Reply
    • Link to this post#5
    Quote from: bodzio at Jun 08, 2010, 03:01 AM
    fajnie by było, ale jak wpisuje:
    [[GetField? &docid=`316` &parent=`0` ]]
    to otrzymuje tylko tytuł strony a nie treść

    Nie zapoznałeś się z dokumentacją.
    # $field [ string ]
    # Name of the field for which to get the content:
    # - any of the document object fields (http://modxcms.com/the-document-object.html )
    # - template variable
    # Default: 'pagetitle'

    Nic więc dziwnego, że dostajesz tytuł, ponieważ jest to domyślnie zwracane pole. Nie określiłeś parametru 'field'. Prawidłowe wywołanie w Twoim przypadku powinno wyglądać tak:
    [[GetField? &docid=`316` &field=`content` ]]
    


    Parametr 'parent' jest domyślnie ustawiony na 0 i odpowiada za to, że gdy umieścisz GetField w dokumencie podrzędnym, to zwróci zawartość określonego pola w dokumencie rodzicu.

    Bardzo przydatny snippet. Polecam.





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
bodzio, fixedmachine

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy