Page Quota Setup

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
We understand custom modules can live on profiles, and be setup into Quotas.
What if we want to write code for a custom page or set of pages, and allow users to subscribe to those pages? For example: MySite.com/MyCustomApp - would live at the site level instead of the profile level, but still allow users to subscribe to MyCustomApp at the site level.

Question: Can custom Site Builder page(s) be restricted to a certain quota and allow users to subscribe?
updated by @softdesigns: 08/24/17 02:37:41AM
michael
@michael
7 years ago
7,714 posts
Your modules take control of a url at site level.

site.com/audio

Is controlled by the audio module. By default the page that shows in that location is:
/modules/jrAudio/index.tpl

You dont have to build a profile component for your module if you don't want to.

Sure, you can add a smarty function into your module that can check the access to any page via any criteria you like.

eg: into your modules include.php put
function smarty_function_xxYourModule_check_access($params, $smarty){.......

Then into any template you can call that function with {xxYourModule_check_access} and do whatever before showing the page.

Docs: "Defining your own smarty function"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1569/defining-your-own-smarty-function

You can then define any sub-pages you like
site.com/audio/elephants

will first look for a function in jrAudio/index.php called view_jrAudio_elephants() to fire on that URL.

If it doesn't find anything, then it will look for any modules that define a 'magic view' for 'elephants', if it doesn't find it it will search for other things before getting to 404 Not Found.

If you dont want to use the /modules/xxYourModule/templates/index.tpl to define what happens on your modules base url, you can define what happens there by a function in index.php called view_xxYourModule_default() which will fire if index.tpl doesnt exits.

You have a lot of choices for how you want it to flow.

Tags