Help with custom php pages documentation.

DLJonsson

Well-known member
In your documentation you say to set the switch to
$enable_custom_php_pages = 1; to config.php.

I did not find that switch in config.php so I added it.

Otherwise I'm having problems finding information on building and using
custom pages in the documentation.

Can you please direct me to information on

* How to create a custom header for Details page?

* How to create a custom header for Edit page?

* How to display an image in a results template as configured from
a datagrid template in datagrid configurator?

Please advise
 

eugenio

Administrator
Staff member
Hello,
I confirm that the $enable_custom_php_pages is available in the main config.php file, are you sure you don't have it? Maybe you are looking at the config.php file of a prepackaged app?

A custom page is a completely custom PHP page, you can add your own code and do whatever you want. Your questions about to custom headers seem more related to layout hooks, can you clarify better your question?

Best,
 

DLJonsson

Well-known member
enable_custom_php_pages was found at line 216.and has been set to 1.

* Where can I find further information on integrating custom php pages into dadabik?

* Where can I find instructions on layout hooks?
 

DLJonsson

Well-known member
Disregard 2 of my previous questions.

Which answers I've found in documentation.htm combined with comments in custom_functions.php for
How to create a custom header for Details page & * How to create a custom header for Edit page.

The question that remains is

* How to display an image in a custom results template as configured from a datagrid template in datagrid configurator?
 

eugenio

Administrator
Staff member
Hello,
if you are using a custom template it's pure HTML (except form the placeholders e.g. dadabik_field) so it's just the IMG html tag:

https://www.w3schools.com/tags/tag_img.asp

If you already know the file name of the image: no problem, if the file is related to the record, you have to mimic how DaDaBIK retrieve images, it uses an URL like:

index.php?r=......&function=show_file&file_type=image_file&tablename=.....&....

that you need to use in the SRC attribute of the IMG file. If you look at the HTML source code of any classic results grid having an image field type, you will see such type of URL.


Best,
 

DLJonsson

Well-known member
Thanks moving forward now.

Where to I grab the unique "r" parameter?
https://[mysite]/index.php?r=1542618405&function=show_file...

* for custom grid?
* for edit & display page headers?

Thanks
 

DLJonsson

Well-known member
The remaining problem I have is accessing the variables to send to the parameters of the url.

IE. Looking closer at the parameters
&file_field_name=photo1
and r=9999999999

Where do I find or assign the &file_field_name in an edit form header?
What do assign to the 'r' parameter such as r=9999999999?
 

eugenio

Administrator
Staff member
The R parameter is just the current timestamp ( time() function in php ) and it's used to avoid caching problems.

The file_field_name is just the name of the field containing the file, so you should know that in advance.

Best,
 
Top