CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Is ?snippet=1 safe to use on every page ?
Pages: [1]

Author Topic: Is ?snippet=1 safe to use on every page ?  (Read 1717 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Is ?snippet=1 safe to use on every page ?
July 09, 2009, 05:19:44 am
Hi,

I'm trying a customisable quick add form by "ajaxifying" a profile.

http://example.org/civicrm/profile/create?gid=1&reset=1&snippet=1

Seems to work ok, but is it "safe" and futureproof ?

Also, what about having an extra param to return a json of all the variables that would be assigned to the result template instead of the html of the template ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Is ?snippet=1 safe to use on every page ?
July 09, 2009, 07:33:05 am

yes, snippet=1 is here for some time :) (or at least until the new architecture :P)

adding an extra param to output all variables as json is probably doable in the template itself. You just need to dump the contents of the array

$smarty->_tpl_vars as a json element (i.e. json_encode?). Only hassle is in some pages we also send in some objects, which u'll need to skip. We also send in the config and session object which you should definitely not send out

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Is ?snippet=1 safe to use on every page ?

This forum was archived on 2017-11-26.