Jump to content

custom Admin module questions


neosin
 Share

Recommended Posts

I've been reading through the tutorials and have created an admin module based on the ProcessHello example module.

I have a few questions regarding how to do a few things with the module that are not obvious or covered by the processhello tutorial.

Outline of expected module functionality:

  • The custom module admin setup page should contain a list of its editable pages.
  • CMS users will be able to add/edit/delete pages of this module.
  • The modules editable pages use the same defined fields.
  • The editable pages data will need to be available for use by another custom module.

This custom module (called "Stream Encoders") will handle creating/updating/deleting of "Stream Encoders".

The encoders contain various fields such as encoder name, operational status (is it on or off) and brightcove asset ID

A second module in "admin>setup" called "Video Streams" will handle creating/updating/deleting/scheduling of "Video Streams".

Each video stream belongs to a video encoder and uses some of the settings from the encoder selected, such as the encoder title and the brightcove asset ID which on the frontend are used to display the video stream.

My noob questions:

  • Since they are not "pages" in the navigation tree, how do I define these "encoders" to add them to the custom stream encoders module?
  • I don't believe my custom modules should be under "Setup", is it possible to have custom menus in the admin? It's fine if they can't but it would be more intuitive if they had their own menus in the admin instead of living under "Setup".
  • Without having a specific page on the frontend for video streams, how would I access the data for a specific video stream from the home page? for example if I wanted to display a specific or random video stream in a sidebar on the homepage.
  • Are there any tutorials on using scheduling with custom modules? The video streams can be scheduled or turned on/off as desired by the CMS users.

thank you in advance

Link to comment
Share on other sites

1 hour ago, neosin said:

Since they are not "pages" in the navigation tree, how do I define these "encoders" to add them to the custom stream encoders module?

A PageTable field perhaps? That way, you can factor most options out of module settings pages. Or just use regular (hidden) pages without a dedicated php template under an extra page in the page tree and allow creation of new pages in the field's options (parent and template need to be configured for that to work smoothly). It's also possible to add your own pw-modal link to edit and create new encoder pages from a custom process module.

1 hour ago, neosin said:

I don't believe my custom modules should be under "Setup", is it possible to have custom menus in the admin? It's fine if they can't but it would be more intuitive if they had their own menus in the admin instead of living under "Setup".

That's not really a problem. See for example @kongondo's blog module. It adds a toplevel entry in the navigation bar for its process module. There's also a wealth of information on that topic in @bernhard's blog entry on building admin pages.

1 hour ago, neosin said:

Without having a specific page on the frontend for video streams, how would I access the data for a specific video stream from the home page? for example if I wanted to display a specific or random video stream in a sidebar on the homepage.

Either just make them pages, or give your module (best not the process module) a method that returns the stream data and call $modules->get("YourModule")->yourMethodThatReturnsStreamdata() in the frontend template.

1 hour ago, neosin said:

Are there any tutorials on using scheduling with custom modules? The video streams can be scheduled or turned on/off as desired by the CMS users.

@formmailer's Schedule Pages module might already be quite close to what you want.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, BitPoet said:

A PageTable field perhaps? That way, you can factor most options out of module settings pages. Or just use regular (hidden) pages without a dedicated php template under an extra page in the page tree and allow creation of new pages in the field's options (parent and template need to be configured for that to work smoothly). It's also possible to add your own pw-modal link to edit and create new encoder pages from a custom process module.

That's not really a problem. See for example @kongondo's blog module. It adds a toplevel entry in the navigation bar for its process module. There's also a wealth of information on that topic in @bernhard's blog entry on building admin pages.

Either just make them pages, or give your module (best not the process module) a method that returns the stream data and call $modules->get("YourModule")->yourMethodThatReturnsStreamdata() in the frontend template.

@formmailer's Schedule Pages module might already be quite close to what you want.

thank you so much, this will help me out for sure and set me on the right path to success with PW!

much appreciated

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...