Is there a build in way to create a menu/menu items (FRONT-END!) during installation of a component?
This is not about the .xml file in the tmpl folder!. What I'm after is to have a Joomla 3 menu (plus menu items to my views) ready to use after I installed my component.
I know I could write some SQL and insert directly into the Menu / Menu_item tables. But that doesn't feel right. With all the setup option available it seem strange not to have the option to crate a front-end menu.
What I mean with option is: in the manifest file I can use within the administrator section to create my back-end menu, which is stored in the same db table (different type). But I can not do the same for the front-end?
If I must use the SQL approach, when/where/how?
Or do I have to write/install a plugin to achieve this?
Regards
Andreas
You can create the installer script file, and write there some code which will run e.g. after your component is installed in: administrator/components/com_xyz/script.php
class com_xyzInstallerScript {
function postflight($type, $parent) {
//...
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->insert($db->quoteName('#__menu'))
->columns( ... )
->values( ... );
//...
}
}
You can search in the joomla installation .sql scripts for more ideas related with the menu module. E.g. in installation the mainmenu is by default populated.
I guess it is more complicated when it comes to front-end menu and there is no current support in the component's installation file (at least i dont know any). In the administrator, the menu item will appear in an existed menu - the Components menu -, and the harthon template is usually used, wheres in the front-end the menu must be created from scratch.
Related
I have a local WordPress site running on MySQL. I wanted to move it to a server for testing and deployment. In addition to migrating new/changed code and media files, I exported the database from my local machine to a .sql file using Sequel Pro on Mac. Then I changed all URLs in the export to match the URL of the server. Then I imported it to the server database.
Everything's fine. No errors. Except the menus I created on my local machine are not showing up on the server. I'm seeing recommendations for plugins to export menus and import them on the server. But that seems silly to me. Aren't menus defined in the database? Isn't everything defined there in terms of content, options, settings, etc.? Why would I need to export/import menus and nothing else?
When you export and import the database of the wordpress site, the menus also include in it.
You just need to check in your admin panel the menu will be there. You just need to assign that menu for appropriate menu location like primary or which you have created, like this screenshot https://prnt.sc/1wp2gvd
The answer was that I was using a Pantheon.io-based upload/import feature to upload and import my .sql file. When I instead used Sequel Pro on MacOS to export my local database, connect to and import it to Pantheon.io, everything came through.
I use Intellij to inspect databases, run sql, view data in tables etc. This all works fine but the only thing I am missing is the ability to define these datasources once and view them in all my projects i.e. that I can share them between other projects and not have to redefine them for new projects. Is this possible in Intellij?
Go to the Database tool window and click on the Data Source Properties button. Select the data source you want to make global. Click on the Make Global button in the tool bar above.
The Make Global button looks like this:
Now you can use the data source from all your projects. However a global data source is not stored in the project files, so any other developers working on the same project will need to define their own data source.
The Make Global button is no longer green (Intellij Ultimate 2018.02).
It's located above the datasource list, as in the (crappy) screenshot.
In Intellij 2020.1, click on the Database view, then click on "Data Source Properties" (database with wrench icon). On the dialog that opens, click on "Make global", which is the 5th icon (screenshot below).
In IntelliJ 2019.1, 2019.2 to share connection to DB with multiple projects:
Open Database panel
Datasource Properties
Make Global
So how I did it on 2018.3 was to go to the Database tool window then right click on your datasource you want to copy then Database Tools -> Copy Datasource to Clipboard. In the Database window for the project you want to copy to click the + at the top left and it has an option to Import from Clipboard.
In IntelliJ 2019.3 to share connection to DB with multiple projects:
. Open Database panel
. Data source Properties
. Click the blueMake Global button
I want to migrate all views from my local site to another site.
I know there is a module "Migrate" which allows you to do data migration but I don't know how to use it.
Can you give me some tips?
Thanks in advancej
Not sure what you mean with migrating views to another site. In Drupal, the migration concept is usually associated with actually migrating data - a view is actually just a way to query and display this data.
Typically moving a view to a different site, assuming data structures are the same in both can be accomplished by either exporting the view (one of the options while browsing the views on admin/structure/views) or, if it's not just a one of, by featurizing it which is a process that takes a few more steps.
It's only applicable for drupal site to drupal site
First download features module and enabled in both sites.
Go to admin-structure > features > create feature.
In that you can see General information(left side) and Components(right side). The General information provide some name in the name fields and you can see views in Components. You just select what are all views are needed for that site.Click the Download feature button.
It will downloaded!!!
After that copy the downloaded file to new drupal site which has drupalroot > sites > modules.
Go to your "new drupal site" as (Admin-Structure > feature). You can see the folder name as list in that. Enable the folder name list and click "Save settings". After the save setting finished as good then deselect the folder list, click "save settings" and delete the downloaded folder in module folder.
Note:
The folder name list should not state as conflict. If it presents, then click the recreate button.
I have a wpf application, which has file menu and can open and save projects. I am using Prism and MEF.
Now I need to have a wizard showing the user:
To continue as usual
MRU history so that he can load the project to the work area by double clicking.
MRU service is also in a module(dll), which we add to the catalog in mefbootstrapper.
What would be the best way to achieve this?
As commented above, there would be no need to show the Wizard before loading the Shell:
Using OnDemand modules as you mentioned, you could create an initial generic ShellView, perform the Bootstrapper tasks and finally show the Wizard with the Shell and Bootstrapper already initialized, and the Wizard would then decide the flow of the app according to the user choice.
As the Modules would be loading OnDemand, you would not be initializing unnecessary Modules or objects.
Regards.
I have thousands of pages which i need to export from qa to production. I have seen the export page function but is there a way to do this in batch? I have found code to create pages but not to extract them. All permissions and settings must also be copied.
You could use the Portal Templates (export) feature found under the Host/Sites page.
That will generate a template for the site, then you could transfer that to production (that would be a couple of files) and "apply" that template to your existing site.
The other option would be to backup/restore the database, that is how most people handle changes between staging/production. Though that assumes any changes already made in Production exist in Staging.