Jump to content

Custom Module which has more than one page?


pjs32

Recommended Posts

Ok so my understanding is that to add a module, the filename has to be the same as the module folder name...

 

i.e if folder name is \my_module\ then the file in there has to be my_module.php

 

Ok, so the problem I have is that my page interacts with other pages to function. But obviously it can't find these files because it looks for it where "addonmodules.php" is and not in the module folder....

 

If I adjust the link to the full URL, it works, but obviously loses the template (top nav, left nav etc etc)

 

Anyone got any ideas?

Link to comment
Share on other sites

you could use

if($_GET['action'] == 'ACTION_NAME_HERE')

{

include 'FILENAME_HERE';

}

 

the a href links than become

<a href="'.$modulelink.'&action=ACTION_NAME_HERE">my addon module</a>

 

 

for the main page of the addon you use

if($_GET['action'] == '')

{

Your PHP code

}

 

This is how I do all my multipage addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated