I'm working in OpenCart 1.5.5 on some sort of newsmodule for in the side bar. I've got it all running in the back-end, but i don't know how i could asign this module module/aselsi to the right side bar on the home page, product page and category page.
I've already looked in some source code's, but i don't fully understand how this particilur thing works.
I did try to make it work by inserting in the DB tabels oc_layout and oc_layout_route some info, but that also didn't work.
So my question is: How can i make my extension / module apear on the front-page?
By running in the back-end I guess You have created a custom controller, model and view for some form where You manage Your news. That is OK.
But since this should be a module You also have to create a backend part for this module so that it could be installed and assigned to the layout on certain pages. The simplest way how to do this is to copy these files:
admin/controller/module/banner.php
admin/language/<YOUR_LANGUAGE>/module/banner.php
admin/view/template/module/banner.php
into Your new
admin/controller/module/aselsi.php
admin/language/<YOUR_LANGUAGE>/module/aselsi.php
admin/view/template/module/aselsi.php
and rename all the class names, constants, model and language file names from banner to aselsi. After this You should see a new Aselsi module under Extensions > Modules in You administration where You should be able to assign this module to pages and positions...
Just want to mention that simple copy-paste + rename is not enough, You would have to edit some other parts as well to get it working.
EDIT: I'm not at the code right now, but yes, You are right, it has a lot to do with that line You are mentioning in comment. Each module setting is saved as serialized string (which is a serialized array) which contains module settings - layout, position, sort_order, etc. The key is the module key - aselsi in Your case, same as all other modules has their own modules. By only installing the module You set the module as active but You can show the module by saving it's settings. In frontend controllers for left, right column and top and bottom content the active modules are then populated and all set to display on that layout and on that position are displayed then.
The installing/uninstalling of module (in backend) can be extended to e.g. add/remove new DB tables for that module and/or for altering current DB tables (by adding new columns, etc.) by implementing install and uninstall methods with their respective logic.
I hope this simple explanation helps a little.
Related
I want to show all the articles from a certain category in different module positions.
How I think it needs to work. I make a plugin that collects all the articles with their information in a central array. This array get emptied one by one in the module positions that I specify. I presume you'll also need a module that adds to the plugin so the plugin needs to know where the items need to go.
But is this the way to go or do you recommend something different? Maybe it already exist in a component or module?
Why are you making your own plugin to show Joomla article since Joomla already have it Just follow the following steps to create article category module in Joomla.
Create module under extension->module->new->choose-Article-categories
Now choose the article category and the position where you want to publish it. You can choose already available positions or you can create it on the fly.
If you want to publish module in custom position then check this link https://api.joomla.org/cms-3/classes/JModuleHelper.html
I am building in Joomla! version 3.3.6 for my first time. I have built a ton of custom Wordpress in the past. The first challenge I have encoutnered, is the requirement of building a page which does not look anything like the template pages. The client desires a landing splash page, with large images and a gradient background. However, they are using a template already. Now, I know that I shouldn't start my research on Stack Overflow, so I've watched hours of tutorials for beginners on Lynda.com. No one seems to be covering this topic. Any help would be really appreciated.
To explain this idea, I will compare to what I would do in Wordpress. I would create a file named "page-splash.php" and give it a template name: Splash. Then I would fill this page with my choice code. Finally I would create a "Page" object in wp backend and give it the "template" of "splash".
This is very possible and often accomplished in Joomla.
You would simply need a second template installed and assigned to the page. In Joomla, you could technically have a different template installed for every single page if you wanted to. But in this case, you just need a 2nd template.
Start by building a bare bones template, as found here: https://docs.joomla.org/Creating_a_basic_Joomla!_template (or copy the current template from /templates/ directory and update the templateDetails.xml file so it will install as a second template)
Install 2nd template via Extension Manager
Next, make sure your new page is linked within the Menu Manager (as you will need a menu assignment to call the new template in next step)
Go to Template Manager and you can assign your new template to the menu item defined in the previous step.
You now have 2 independent templates running on the same installation and they can be styled and configured independent of one another.
Assigning more than one template is such a common task in Joomla that you can find more details about this in the official documentation: https://docs.joomla.org/J3.x:Switching_templates
Joomla is by Default not a Blog/Template layout cms, but rather a web application builder.
You can get extensions to create custom templates that make Joomla function like a blog application such as ZOO or K2. I would not go the route of creating individual templates for each page as it would be similar to installing a different theme for each page on a WordPress site.
I am new to Magento. I am working on Magento 1.8 and having problem while creating multi-store-views for different language's. I have done some configuration from backend, I gpt the multiple-store-view. Its converted from English to French but its not converting to Malaysia language. my steps are as follows
Note: I am using responsive custom theme.
Go to the site: http://www.magentocommerce.com/translations and download the proper language that you are looking for.
Extract and upload the files you downloaded to your Magento’s root directory. Keep in mind it will upload files to your app folder in Magento, but unless you try with a language that you already have there, it won’t overwrite anything as it’s a new language.
Once you finish uploading, go to your Magento’s Admin.
Go to: System>Manage Stores.
Click on “Create A Store View”.
Once there comes the really important thing: Put the name you want for the “Name” field, but in your “Code” field, make sure you enter your main theme followed by a “_” (underscore) and then the name of the language you want to use. Even if you used a new template that you did or purchase it would be under a main template type (default or base). Let’s say you have a new template you purchased called “MAG0873″ and its folder resides under “default”. Also, let’s say you installed Spanish language, then you would put “default_spanish” in this field.
Save it and now go to: System>Configuration.
There, select your new Store View name from the “Current Configuration Scope” item in the top left column.
Now, go to the option: General>Locale.
After that, uncheck the option “Use Website” and make sure you change “Locale” field to the language you downloaded (be specific according to the dropdown list!).
Save it after changing it and now clean your cache and refresh your FrontEnd.
Now, few important things:
If you didn’t deactivate the original Store View a new dropdown will appear in the FrontEnd to change the language and the new Store View’s Name will appear there. Once you select it, the entire template should switch its language.
It might happen it switches language but, it also shows old/default template, well, no worries, this means you need to set up your new Store View to use the proper template according to your design set up. The next steps are specific for the persons who install templates through the System>Design option as I do (which I think is the easier and faster way).
Go to System>Design
Add a new Design.
In the “Store” field, select the new Store View you recently created.
.Now select the “Custom Design” you previously installed in your system.
Save it.
Now, your store should be using the proper design in the proper Store View (language).
Ok, now it happens that the hoe page doesn’t show exactly as you had it on the original (English) language? Well, it might be happening that the Home page is set up for an specific Store View. To fix it, just go to CMS>Pages, now click on the “Home” record (assuming you are using default settings that come with Magento) and then in its options make sure you have “Store View” field set up to “All Store Views”. Save it now.
What's mistake i have done here.
Thanks in advance
If you'd like to have a well configured multi-language Magento setup you need to follow the steps below:
Setup a separate Store View for each language (System -> Manage
Stores -> Create store view);
Apply a Locale for each Store View (System -> Configuration ->
General -> Locale Options, select Desired Store View in "Current
Configuration Scope" drop-down in left-side navigation);
Make sure that you have translated all of your CMS pages to all of
your languages. You need to create a unique CMS page for each store
view;
If you'd like to use a separate theme for each language just do it in
System–>Configuration–>General under the Design tab;
In case you need to make a different set of categories in Navigation
menu for each store view, you may control it by "Include in Navigation
Menu" category attribute (Just choose a category for edit and go to
General Information tab). Change all text attributes in Catalog Products and Categories for
each store view
The more detailed guide find here:
http://sherodesigns.com/magento-tutorial/magento-tutorial-creating-multi-language-stores/
I'm building a theme for my site with some particularities so I need to know if modules slideshow and module promotions are enabled or not, how do I know this? Can I check this from templates?
Due to the nature of how modules can have more than one on a store, and be in different regions of a template (layouts) this is quite difficult to do. You will have to query the layout and position much like the column left/right and content top/bottom do in order to see if the module is available in that particular region and on that specific page. For how to achieve this, see the code inside the controller of your particular install version catalog/controller/common/column_left.php for example
That said, most custom theme developers will create their own modules for the specific region you want them to be in so you can control this and check the status of the module using $this->config->get. This would be my choice of how to achieve this so you're not reliant on other modules for your theme
my question sounds simple, but for me it isn't, i'm developing a joomla module and i want to use it multiple times and at different different position on each page load, can you just guide me? or gimme an example to accomplish this task? your help will be much appreciated.
Googling didn't helped me this time
Are you creating a module or a component? A component can only be displayed once per page and only in the area designated in the template by the tag. A module can be displayed several times per page and in several positions in your site. Simply go to the module manager, click on "New", fill in the details and the position and click on save.
It depends a little on which version of Joomla you're using (you don't say?), but in Joomla 1.7:
Administration Area -> Extensions -> Module Manager
Select the module you want to duplicate (tickbox to the left), hit the 'Duplicate' button at the top.
Now there are two separate modules, that use the same /DOCROOT/modules/mod_MODULENAME.php file for their logic. They can be assigned to separate module positions (or different pages), and given separate module parameters. You can have as many 'copies' of a module as you want. You can give them different names - but they'll all have the same 'Type' (this refers to the actual PHP file they use).
You'll probably notice that the example modules that come with Joomla are often copies - especially of common modules like 'Custom HTML'.
I've seen this confusion before, between a module (a small bunch of files you install that go in the /modules/ directory), and a module (the use of that bunch of files in the admin area, that appears on your site - it's actually a row in the Joomla database). When you first install a modules files, Joomla creates a single copy of the database row for you to use.