Hi, I used the: <script>
new AppGiniCommon().setTitle("<b>PROJECT_</b>DataTool");
</script>
<script>
new AppGiniCommon().setIcon("plus");
</script>
<script>
var common = new AppGiniCommon();
common.autoRedirect();
</script>
within the JS purchased library to personalise the home button name and link. It works fine (added to hooks/header-extras.php) in normal TV/DV pages but doesn't appear* on custom pages (as added in recommended way - https://bigprof.com/appgini/help/advanc ... cess-pages). How can I get the script to work in the custom pages as well as the main pages? Thanks.
*I just get the standard house glyphy thing and the original title.
script not working with custom pages
Re: script not working with custom pages
tl;dr
--
Hi,
there is a chapter named "Tips / Custom pages" on the "how to integrate" page:
https://appgini.bizzworxx.de/products/j ... tegration/
According to the docs you have mentioned (https://bigprof.com/appgini/help/advanc ... cess-pages) you will have set the PREPEND_PATH constant in the beginning of your custom page:
That constant can be used in hooks/header-extras.php for resolving the correct path to the hooks directory.
Just replace...
...by...
You will find a similar question and answers in this older thread here:
viewtopic.php?t=3752
Code: Select all
<!-- file: hooks/header-extras.php -->
<script src="<?=PREPEND_PATH?>hooks/AppGiniHelper.min.js"></script>
Hi,
there is a chapter named "Tips / Custom pages" on the "how to integrate" page:
https://appgini.bizzworxx.de/products/j ... tegration/
According to the docs you have mentioned (https://bigprof.com/appgini/help/advanc ... cess-pages) you will have set the PREPEND_PATH constant in the beginning of your custom page:
Code: Select all
// ...
define('PREPEND_PATH', '../');
// ...
Just replace...
Code: Select all
<script src="hooks/AppGiniHelper.min.js"></script>
Code: Select all
<script src="<?=PREPEND_PATH?>hooks/AppGiniHelper.min.js"></script>
viewtopic.php?t=3752
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: script not working with custom pages
By the way: I recommend initializing objects like AppGiniCommon only once.
So instead of...
... (which is triple initialization of an object of class AppGiniCommon) ...
... I recommend ...
... (which is a single initialization) ...
... or ...
... for avoiding side effects and for better readability.
Recommendations @all
According to the updated docs here https://appgini.bizzworxx.de/products/j ... mentation/ there is a recommendation especially for DV but also for TV. In DV there were a few problems, users reported, when initializing AppGiniDetailView multiple times, for example in header-extras AND in TABLENAME-dv.js.
Recommendation for DV
Recommendation for TV
Your code should still work, but in case you are facing problems with multiple initializations, please get used to using the new helper functions which are available since version 2020/10
So instead of...
Code: Select all
<script>
new AppGiniCommon().setTitle("<b>PROJECT_</b>DataTool");
</script>
<script>
new AppGiniCommon().setIcon("plus");
</script>
<script>
var common = new AppGiniCommon();
common.autoRedirect();
</script>
... I recommend ...
Code: Select all
<script>
new AppGiniCommon()
.setTitle("<b>PROJECT_</b>DataTool")
.setIcon("plus")
.autoRedirect();
</script>
... or ...
Code: Select all
<script>
var common = new AppGiniCommon();
common.setTitle("<b>PROJECT_</b>DataTool");
common.setIcon("plus");
common.autoRedirect();
</script>
Recommendations @all
According to the updated docs here https://appgini.bizzworxx.de/products/j ... mentation/ there is a recommendation especially for DV but also for TV. In DV there were a few problems, users reported, when initializing AppGiniDetailView multiple times, for example in header-extras AND in TABLENAME-dv.js.
Recommendation for DV
Code: Select all
var dv = AppGiniHelper.DV;
// your code here
Code: Select all
jQuery(document).ready(function() {
var tv = AppGiniHelper.TV;
// your code here
});
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools