$options variable when Pagekit not in www root directory

  • I have published the Mercator Gallery plugin in the Marketplace. It works as designed when PK is imstalled in the www root. However, when PK is installed in a subdirectory, I have the problem that the $options variable seems not to be set when PK calls my plugin MercatorCReateGallery. Is there anything I need to include so the $options array is set before I can access it? And as I said, it works when PK is installed in the root.

  • Here‘s the code fragement. $options seems not to be set when Pagekit is installed in a subdirectory. See line 40 of the code. It is set, when Pagekit is installed in the www root.


  • This behaviour is strange. Are you sure, you are using the correct plugin syntax?


    Below you see the code which evaluates the plugins. According to your class you should use

    (mercator_plugin){option1: 1,  option2: 2}

    in the editor which will call your plugin with $options = [ 'option1' => 1, 'option2' => 2].

    But I think you did that right?! The problem is now, that this options are only available if pagekit is in www root. That I cannot explain, as there is no connection visible in code ...

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7


  • Yes, i called it that way. The problen really is that $options is empty when print_r in line 40 of the code. I would have PK expected before it calls that funtion...

  • What dir option? Is that the dir from where you want create the gallery.


    If you pass a path as options, it gets critical with the regex, as / has a meaning there. Have you tried to escape your path? e.g. \/

    The hole content is matched for plugin compatible string. Probably using paths does not match anymore the specified regex used to find the plugin shortcuts.

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • Mercator

    Changed the title of the thread from “$options variable when Pagekit not in www roor directory” to “$options variable when Pagekit not in www root directory”.
  • What dir option? Is that the dir from where you want create the gallery.


    If you pass a path as options, it gets critical with the regex, as / has a meaning there. Have you tried to escape your path? e.g. \/

    The hole content is matched for plugin compatible string. Probably using paths does not match anymore the specified regex used to find the plugin shortcuts.

    dir is the name of the parameters that should end up in the options array. Even if you make the value eg XXX it does not get passed on.