Hi,
It is your .htaccess in the GS data directory that blocks access. You must either allow it there to access your framework/, or modify the .htaccess in IM root with "Allow from all". IM3 has its own .htaccess file, it already protects all the important files/dirs.
The data/ is not the best position for the library. I would rather write a plugin for it and place the library folder there (but that's your thing). For example:
So you could write a function which renders your gallery images and then output it in the template.php with e.g. show_gallery(); etc.
This is the URL not a path. Use that:
If you define it globally before then, sure. For example, if you have something like that in your functions.php:
Because the functions.php is called before your template.php your $item is also available in the template.php.
Here is an example plugin: ImGallery
Activate for testing and add a [[im_gallery]] placeholder in the content of a page where you want to show your gallery output.
Your template must contain <?php get_page_content() ?>
(2020-08-12, 07:15:53)Felix Wrote: Is this because a permission needs to be set somewhere for IM3 ?
It is your .htaccess in the GS data directory that blocks access. You must either allow it there to access your framework/, or modify the .htaccess in IM root with "Allow from all". IM3 has its own .htaccess file, it already protects all the important files/dirs.
(2020-08-12, 07:15:53)Felix Wrote: Is this correct inside the GS CMS function.php file ?
The data/ is not the best position for the library. I would rather write a plugin for it and place the library folder there (but that's your thing). For example:
Code:
plugins/
your_plugin.php
your_plugin/
framework/
imanager.php
So you could write a function which renders your gallery images and then output it in the template.php with e.g. show_gallery(); etc.
(2020-08-12, 07:15:53)Felix Wrote: include get_site_url(false) . 'data/framework/imanager.php';
This is the URL not a path. Use that:
Code:
include dirname(dirname(__DIR__)).'/data/framework/imanager.php';
(2020-08-12, 07:15:53)Felix Wrote: will $item be available globally ?
If you define it globally before then, sure. For example, if you have something like that in your functions.php:
PHP Code:
$gallery = $imanager->getCategory('name=Gallery');
$item = $gallery->getItem(1);
Because the functions.php is called before your template.php your $item is also available in the template.php.
Here is an example plugin: ImGallery
Activate for testing and add a [[im_gallery]] placeholder in the content of a page where you want to show your gallery output.
Your template must contain <?php get_page_content() ?>