Create a outout layout for file field

  • Published by
    Yannick Berges
  • Last modified
    20 March 2019
  • Up to date
    Yes
  • Profile concerned
    Developer
  • Concerns
    Plugins
  • Since Version
    3.X
  • Voting
    Average rating
    4 votes
    • 1
    • 2
    • 3
    • 4
    • 5
  • Favourites
    711 Create a outout layout for file field /documentation/tutorials-english/70-developer-api-field-plugins/711-create-a-outout-layout-for-file-field.html

you duplicate the default layout file:

/tmpl/value_*.php

in file field case it is
/tmpl/value_InlineBoxes.php

about the contents of the file, read whatever inline comments exists
there will never be "documentation" for editing layout files
customizer is supposed to read comments in the layout file

in your case you can use variable
$abspath

Try adding BEFORE

// Values Prefix and Suffix Texts
	$field->{$prop}[$n]	=  $pretext . $html . $posttext;


something like

$html .= '<br>'.  $abspath;

test the result

then change to

$html .= '<br>'.  str_replace('\\', '/', $abspath);


and then change to

$html .= '<br>'.  JUri::root() . str_replace('\\', '/', $abspath);


etc until you get the result you need aka you and the HTML that you need

then you can also disable default output that you do not need in field's configuration