1

Background: I am starting to package up three associated custom Joomla extensions that I've developed. (This is directly associated with my previous JSE question, if you want more context.) The package contains a component (com_o3_picture) that started as a clone of com_contact from the core, then was adjusted to suit client needs. Additionally, there is a editors-xtd plugin to generate placeholders into Articles and a content plugin to replace the placeholders with dynamic content.

Because I am using much of the same functionality of com_contact, my install.mysql.utf8.sql file creates a #__o3_picture_details table. This is successfully done already.

A couple of months ago, when I test-installed my component by itself, I realized that I didn't have the Pictures>Pictures and Pictures>Categories submenus that I needed in the Administrator Menu's Components>Pictures (to mirror the options that Contacts provides). So I manually inserted some rows into #__menu to solve the problem. This was something that I "eye-balled" because I needed to reference generated ids to properly assign the parent-child relationships.

Questions:

  1. How do I automate the Menu option process? Can this be cleverly done in the install.mysql.utf8.sql? or do I use a preflight call? or postflight? or an entirely different/better way?

  2. I know I need to insert to #__content_types. Are there any essential rows in other tables that should be inserted/updated? I mean, #__assets is a table that might not need to be spoken to, but I'd rather do everything in my install rather than running a sync from PWT's ACL asset fixer. Another example is #__associations -- I don't think I need to do anything to that one do I?

How can I be sure that I've created everything that is expected? Trial and Error? ...I'd rather not. Anyone have some experience/expertise to share?

  • Thank you for your concern regarding fringe cases with future extensions, but for this project, integrating K2 is not planned. I believe that Sharky's answer is what I am looking for, but I haven't finished packing things up and therefore haven't tested my package install. Once I have run the install, I'll be able to accept or ask for further support/clarification. – mickmackusa Feb 8 at 8:23
1
  1. Administrator menu items can be added to manifest file's <administration> section:

    <menu img="class:example">COM_EXAMPLE</menu>
    <submenu>
        <menu
            link="option=com_example"
            img="class:example-items"
            alt="Example/Items">COM_EXAMPLE_ITEMS</menu>
        <menu
            link="option=com_categories&amp;extension=com_example"
            view="categories"
            img="class:example-cat"
            alt="Example/Categories">COM_EXAMPLE_CATEGORIES</menu>
    </submenu>
    

    https://docs.joomla.org/Manifest_files#Menu_links_and_submenus

  2. Unless you want to insert some sample items on installation, no. Component record will be added to #__assets table automatically.
  • Would you mind tailoring your snippet to closer align with the context in my question? And I didn't come across this menu-submenu advice while researching; can you provide a reference to the Joomla Documentation about this technique so that I (and researchers) can read more? – mickmackusa Feb 7 at 9:14
  • Added link to documentation. What changes do you propose to the snippet? – Sharky Feb 7 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.