Dashboard > Atlassian Plugins > ... > Macros > text-data
  Atlassian Plugins Log In | Sign Up   View a printable version of the current page.  
  text-data

Added by admin , last edited by David Peterson on Sep 16, 2008  (view change) show comment
Labels: 

{text-data}

Plugin: Scaffolding Plugin

Allows editing of free text data.

Usage

{text-data:Name|type=[line, area]}Default text.{text-data}

Parameters

Name Required Default Description
[default]/name
The unique name of the text data field.
type
line
The type of field. May be one of the following:
  • line - (default) A single-line text field.
  • password - A single-line password field.
  • area - A multi-line text area field.

Note: Storing data with the 'password' type is not secure - it is not encrypted when stored. At best, it obscures the value when viewed on the screen.

content
wiki
The type of content in the field. May be one of the following:
  • wiki - (default) The content is wiki markup.
  • text - The content is plain text.
  • noformat - The content will appear inside a {noformat} section.
  • quote - The content will be quoted.
  • code:language - The content will be rendered as code, with an optional programming language such as Java or XML. E.g. 'content=code:JavaScript'. Whatever languages are valid for the {code} macro can be used.
minLength
If specified, the text must be at least this many characters long.
maxLength
If specified, the text must be at most this many characters long.
width
The width of the text field. E.g. '250px' or '100%'.
height
The height of the text field. E.g. '250px' or '100%'.
required
false
If true the field cannot be empty.
pattern
The regular expression the text must match. (Since 3.1.0)
patternInfo
If the pattern is specified, this is displayed if the saved value does not match it. (Since 3.1.0)

Examples

Login details

Username: {text-data:Username|width=100px}{text-data}
Password: {text-data:Password|type=password|width=100px}{text-data}

Large text area

|| Address: | {text-data:Address|type=area|width=400px|height=150px}Street,
City, State, Postcode
Country{text-data} |

Recipes

See Also

Is there any way in a type=area text box to make it automatically wrap after the typing reaches the end of the box instead of producing a horizontal scroll bar?  Should I be using a different tool here.

That's what it should be doing. You might need to set the height to something larger, or there might be a CSS conflict going on somewhere...

What's your wiki markup for the {text-data} field in question?


{hidden-data}
State estimated cost here.
{hidden-data}
{text-data:cost\|type=area\|content=text\|width=80%\|height=250px}


Well I had a screen but i can't seem to figure out how to post it, but...
 
 There is a scroll bar and the only way to get to the next line is to hit enter.  I'd like to avoid this if possible.

Assuming you don't actually have the backslash characters in front of the '|' characters it looks fine. I would suggest there is a CSS issue somewhere.

Yeah no backslashes .  How can I troubleshoot for CSS because I was unaware that I was even using CSS anywhere.

I am assuming that the "h5. Login details" after the required parameter is a typo.

Regards,

Cornelis.

Yeah, good catch. Fixed

I created a page in Confluence 2.9.1 using the Scaffold plug-in and a template, so that I can make use of the text data form fields that Scaffold offers in the edit mode. The template uses some of the Scaffold macros (only excerpt-data text-data for right now) and I use live-template:Division Overview for the layout of the actual page so it displays the contents of the template, where "Division Overview" is the template name.  When a user enters text into the text box and saves, the history shows a new version because of the save, but it does not show that there were any actual changes, so it says that there are 0 changes between the two versions. It only shows changes if the underlying layout of the page is changed. I would like the history to show the changes made by the user when they entered text into the text boxes/form fields. Is this easily doable?

I have also tried to put the contents of the template in the layout itself, but it does not make a difference in terms of the history changes.

Hey Matt,

This is not feasible at the moment. There is no way to have a change history on the contents of scaffolding data, as this does not incorporate into the Confluence change history of pages. Sorry.

There is a way you can view history, using the reporting plugin. This won't fully solve your problem, but at least allows a user to see who changed what, and when they did it. You can include this code in your template. You can expand and collapse the history using the "cloak" macro. You would need to change the "report-info:data" specifications to your data keys (the names of your scaffold fields).

{composition-setup}

  {toggle-cloak:id=History} *History*
  {cloak:id=History|visible=true}
    {report-table}
      {local-reporter:content:version history}
        {date-sort:content:modification date|order=ascending}
      {local-reporter}
      {report-column:title=Date}{report-info:content:modification date|format=MMM dd yyyy HH:mm}{report-column}
      {report-column:title=Modified By}{report-info:content:modifier}{report-column}
      {report-column:title=Status}{report-info:data:IssueStatus}{report-column}
      {report-column:title=Assigned To}{report-info:data:IssueOwner|render=wiki}{report-column}
      {report-column:title=Admin Notes}{report-info:data:IssueNotes|render=wiki}{report-column}

      {report-empty}_No version history available._{report-empty}
    {report-table}
  {cloak}

Great tip Shawn, that works awesome!

Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators