Field captions in custom template

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alescotti73
User
Posts: 57

Field captions in custom template

Post by alescotti73 »

In view of a table I'm using this custom template setup but on page I see captions.
I'm talking about fields from Title to Attache, then from Username till script end it all works fine

<div style="width:100%; padding:1%; white-space: normal; ">

<b>{{{Title}}}</b>
<br><br>
{{{Parent}}}
<br><br>
{{{Description}}}<br><br>
{{{Attach}}}<br><br>

<b>{{{caption Username}}}</b>: {{{Username}}}<br>
<b>{{{caption Category}}}</b>: {{{Category}}}<br>
<b>{{{caption Tags}}}</b>: {{{Tags}}}<br>
<b>{{{caption Date_Creation}}}</b>: {{{Date_Creation}}}<br>
<b>{{{caption Date_LastUpdate}}}</b>: {{{Date_LastUpdate}}}<br>
<b>{{{caption Publish_Type}}}</b>: {{{Publish_Type}}}<br>
<b>{{{caption Visibility}}}</b>: {{{Visibility}}}<br><br>
</div>


kirondedshem
User
Posts: 642

Post by kirondedshem »

If you mean you have used custom template on a view page and you can ot see either the caption or values of some fields of that table then
Please read "Custom Templates" in help menu for clear instructions, otherwise in a summary

  1. ensure that each field in the template has been ticked to appear on that specific form in field settings.

  2. ensure that you have defined correctly where you want a value, caption or input control depending on what custom template you are designing, for example
    to show a caption you put {{{caption field}}}
    to show a value you put {{{value field}}} where filed is the column name

NOTE:values and input controlls can be drawn differently depending on what custom template you are designing, eg some definintions work in custom serach templates but can not work on view templates etc etc, so read about each tag to better undertand it


alescotti73
User
Posts: 57

Post by alescotti73 »

I checked in HELP

"Examples

Example 1 - Custom Template in Add/Edit/Search/View page or Extended Search in List page

{{{Trademark}}}&nbsp;{{{Model}}}<br>
{{{HP}}}&nbsp;{{{Liter}}}
"

I used the same in my file:

{{{Title}}}&nbsp;{{{Parent}}}<br>
{{{Category}}}&nbsp;{{{Tags}}}

But still it doesn't work as expected: on the view page i see caption and I cannot understand why


kirondedshem
User
Posts: 642

Post by kirondedshem »

{{{Title}}}&nbsp;{{{Parent}}}<br>
{{{Category}}}&nbsp;{{{Tags}}}

If you want to see values, then do like this
[Title value]&nbsp;[Parent value]<br>
[category value]&nbsp;[Tags value]

Then try writing it like this.
{{{value Title}}}&nbsp;{{{value Parent}}}<br>
{{{value Category}}}&nbsp;{{{value Tags}}}

If you want to see captions, then do like this
[Title caption]&nbsp;[Parent caption]<br>
[category caption]&nbsp;[Tags caption]

Then try writing it like this.
{{{caption Title}}}&nbsp;{{{caption Parent}}}<br>
{{{caption Category}}}&nbsp;{{{caption Tags}}}

Then just mix them up to get desired result


sangnandar
User
Posts: 980

Post by sangnandar »

alescotti73 wrote:
on the view page i see caption and I cannot understand why

There are:

  • {{{field}}}
  • {{{caption field}}}
  • {{{value field}}}
    These are 3 different things.

{{{field}}} = caption + value
{{{caption field}}} = caption only
{{{value field}}} = value only

If you set this way,
alescotti73 wrote:
<b>{{{caption Username}}}</b>: {{{Username}}}<br>

It will draw: caption + caption + value.


alescotti73
User
Posts: 57

Post by alescotti73 »

tried, it works, thanx! :)


Post Reply