Author Topic: Documentation for item-resource?  (Read 1250 times)

0 Members and 1 Guest are viewing this topic.

Offline skb

  • Occasional poster
  • *
  • Posts: 43
    • View Profile
Documentation for item-resource?
« on: July 25, 2016, 01:56:34 AM »
Is there documentation for %item-resource%?

On the list in the forums at http://www.rejetto.com/forum/html-templates/hfs-templates-vars-and-section-help/ , it is mentioned, but with no explanation.

In the docs on the wiki, at http://www.rejetto.com/wiki/index.php?title=HFS:_Template_symbols , it is not mentioned at all.

More generally, what is a simple way to find out the value of various symbols with test code? That is, while I'm trying to figure stuff out, what sample code could I put into, say, an [upload-completed] event handler to show me the values of various symbols for each file?  Can I write stuff to, say, the java script console?

Or, would it be better to use the [upload-success] section for this sort of temporary debug output?

Thanks for clues,
Steve

Offline skb

  • Occasional poster
  • *
  • Posts: 43
    • View Profile
Re: Documentation for item-resource?
« Reply #1 on: July 25, 2016, 03:54:54 AM »
Nevermind!  :P

After posting I read the recent ticket about "move files after upload", and found Mars' suggestion to use the log for debug output, e.g. add "{.add to log| event upload completed  by %user%.}" to the completed event handler. Works well and easily -- Thanks Mars!!

I used this to print out %item-name%, %item-resource%, and %item-url%. Looks like I can parse the URL to figure out which folder the upload is going to, and the -resource symbol has the windows file path rather than the VFS path.

Any other debugging tips are welcomed!

Steve

Online rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12890
    • View Profile
Re: Documentation for item-resource?
« Reply #2 on: July 30, 2016, 01:35:09 PM »
thanks for reporting, i just added it to the wiki.

to print out variables, without showing them to the final users, you can also put them as HTML comments just by enclosing them in this <!-- strange brackets -->