Jump to content


Photo

Document Variables


  • Please log in to reply
7 replies to this topic

#1 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts

Posted 04 November 2009 - 11:50 AM

This is a full list of document variables that are created when a page is added to your web site. Each can be added to snippets, chunks or templates by simply typing the items listed below.
See below for examples of use.

Most commonly used ones are bolded.

[*id *] - returns the id of the current document (integer)
[*type*] - document / weblink
[*contentType*] - (text/html etc)
[*pagetitle*] title of the page
[*longtitle*] longtitle of the page
[*description*] description of the page
[*alias*] alias of the page
[*published*] published? Yes / No (1/0)
[*pub_date*] published date
[*unpub_date*] unpublished date
[*parent*] document parent (integer)
[*isfolder*] is this document a folder? Yes / No (1/0)
[*content*] what is on the page
[*richtext*] is it rich text? Yes / No (1/0)
[*template*] what template does the page use? (integer)
[*menuindex*] what is the menuindex (order in the tree)
[*searchable*] Is it searchable? Yes / No (1/0)
[*cacheable*] Is it cacheable ? Yes / No (1/0)
[*createdby*] who was it created by? internalKey (id of user)
[*createdon*] date created
[*editedby*] who was it last edited by? internalKey (id of user)
[*editedon*] date last edited
[*deleted*] is it deleted? Yes / No (1 / 0) (deleted means ready to be purged but can still be undeleted).
[*deletedon*] date deleted
[*deletedby*] who was it deleted by? internalKey (id of user)
[*authenticate*] is it authenticated? (do you need to log in to see it?) Yes / No (1 / 0)
[*showinmenu*] should it apear in the menu? Yes / No (1 / 0)

Used in a template or chunk:
<html>
<head>
<title>[(site_name)] || [*alias*]</title>
</head>
<body>
<h2>[*pagetitle*]</h2>
[*content*]
</body>
</html>

Used in a snippet:
$link = $etomite->makeURL($etomite->documentIdentifier,'','');

$out = "<a href='.$link.' title ='[*pagetitle*]'>[*alias*]</a>";
return $out;

See also the etomite Documentation: Templates for more like this.

#2 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 04 November 2009 - 02:06 PM

Although it requires one of another set of tags not mentioned above, the same link can be entered in the following manner... Simply using [~id~] causes the parser to automagically render a document URL based on FURL's configuration settings... Using [*id*] will not work as it will only render the numeric document id...

<a href="[~id~]" title="[*pagetitle*]">[*alias*]</a>


#3 mikef

mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 05 November 2009 - 11:36 PM

is there a list somewhere of which variables are not available for uncached snippets on cached pages?

#4 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts

Posted 06 November 2009 - 11:40 AM

As far as I am aware it's any of the variables above that are retrieved using the $etomite->documentObject() method that has this issue. Perhaps Ralph knows of more. I don't have any problems with cached pages anymore due to
1) my own recursive snippet parser and
2) I don't use documentObject() (or any other snippets that use documentObject()).

#5 bwoodsdesign

bwoodsdesign

    Likes Etomite Forums!

  • Member
  • PipPip
  • 236 posts

Posted 13 January 2011 - 04:18 PM

I noticed that when I use [*editedon*] DocVar on a page's template, it returns a weird number string on the page...

See:
http://www.bwoodsdes...factsheets.html

Can anyone help me figure out how to get it to print out a date format (any kind would be fine, 12/15/10, Dec. 15, 2010, etc.).

Or is there a better way to do this w/some snippet?

Thanks!

#6 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 13 January 2011 - 08:10 PM

I noticed that when I use [*editedon*] DocVar on a page's template, it returns a weird number string on the page...

See:
http://www.bwoodsdes...factsheets.html

Can anyone help me figure out how to get it to print out a date format (any kind would be fine, 12/15/10, Dec. 15, 2010, etc.).

Or is there a better way to do this w/some snippet?

Thanks!


Try using: [[DateTime?timestamp=[*editedon*]]

Both the DateTime and DateTimePlus Snippets were created to be able to handle date variables as well as the current time and other passed dates and formats... As I recall, in the V1.x releases the DateTime Snippet has all of the features of DateTimePlus...

#7 bwoodsdesign

bwoodsdesign

    Likes Etomite Forums!

  • Member
  • PipPip
  • 236 posts

Posted 13 January 2011 - 08:25 PM

Try using: [[DateTime?timestamp=[*editedon*]]

Both the DateTime and DateTimePlus Snippets were created to be able to handle date variables as well as the current time and other passed dates and formats... As I recall, in the V1.x releases the DateTime Snippet has all of the features of DateTimePlus...


Thanks, Ralph! That worked a charm! I wound up using a variation of the snippet call to get the exact datetime string I desired:

[!DateTime?timestamp=[*editedon*]&format=%m/%d/%Y at %r!]

Which gives me: Last updated: 01/13/2011 at 13:51

#8 JessHessing1989

JessHessing1989

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 21 February 2011 - 01:22 AM

Thanks for the info guys

Edited by Ralph, 16 March 2011 - 12:51 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users