I've got a desktop joomla site which uses the database called 'mydatabase'. However, I've created another site for mobile version in a folder in the same host. Then:
www.mysite.com is my desktop webpage.
www.mysite.com/mobile is my mobile webpage.
Both sites, mobile and desktop, are single and independent joomla instalaltions, but they use the same db.
Then when I try to configure the default template to render my contents, I`ve got to choose between mobile contents or desktop contents, but not the two.
How can I render my both templates, so both sites work and live together?
Joomla stores most of its configuration options in the database, thus your question requires some coding to handle it. But let me get one step back.
1. The Joomla approach
Joomla allows you to define which pages show which menus. You could have a simple Joomla installation with SEF turned on, where the main menu is as it is currently in the root.
Then all you need in order to have a /mobile page with a different layout is
Create a new menu (not menu item, menu type) and name it SEF or Hidden; this will not be published anywhere.
Create a menu item with alias "mobile" in that menu.
This ensures your users will be able to surf to the page /mobile and access that menu item.
Now create a menu for the mobile part of your site, add menu items and choose the default template for each, and create a module to display it. Assign it to "Show only on the selected pages" and choose the /mobile page you just created and any others contained within the menu.
Then go back to the main menu module, and configure it to "Show on all pages except", and make the same pages selection.
Now you will have two menus, one for the desktop and the other for the mobile. Aside for the template assignment, they will be identical.
2. Third party extensions
There are third party plugins which allow you to define a different template based on several parameters: country, useragent, screen size etc.
In addition to what you find on the JED, many templates (mostly commercial ones) have a feature to define a custom layout for mobile users.
Whether you handle this with a plugin or with a template is a matter of personal choice; either will work very effectively and be more appropriate than the Joomla answer I outlined above as they will help you prevent duplication. Duplication in content or menu items is costly as maintenance and testing will be harder.
I think that the way you are doing it is very different from the normal Joomla approach (which would be have a responsive template or have the index.php of the template load different subfiles depending on device), but let's assume you have your reasons.
So you have the same database which means all of the menus are the same, all of the module assignments are the same, all of the template assignments are the same and the default template style is the same.
Now, in Joomla template styles are also stored. This is a json string of pairs with various template options.
Simple case, let's assume that both the mobile and desktop template have the same options.
Now in the templates folder of the mobile site we'll have the mobile template.
Call that mytemplate.
In the desktop site you have a the desktop template. Call it mytemplate. Install it ONCE.
So these templates have the same name but because they are in two different physical sites they are in two different physical templates folders, one in the mobile site and one in the desktop.
Now we make mytemplate style-1 the default.
In the mobile site this is always going to load the mobile template while in the desktop site it will always load the desktop template.
Now say we assign mytemplate style-2 to the news menu item. Again the appropriate template is used based on the actual site it is called from.
Now the trickier thing is if you do not have identical parameters. This is likely since the settings you need will be different. In this case, what you will need to do is make sure that the parameters defined in templateDetails.xml include both sets. So if you make a new style you need to always set the parameters for both templates. This is actually going to be helpful since you won't have to configure it twice.
Related
I have ready website built with Bitrix CMS. Now I want to add couple of other languages to the website. Where can I set the multilanguage property for the website?
It is possible. If everything is custom for you, then you need to do it by changing the program code of the site. I will describe the option when a version of a site with a different language is on the same server in one section (< domain of the main language >, < domain of the main language > / < code of another language > / - version of the site with a different language).
You need to add the settings in the administration panel:
make new languages in - “Regional settings”;
make new sites by selecting the languages created above and indicating the site section.
(this is described here https://training.bitrix24.com/support/training/course/?COURSE_ID=68&LESSON_ID=6214)
For example, the second language will be in the section of the current site as /es/.
It is necessary to change the site code:
all texts that are in the component templates (if custom) should be placed in the sections /lang/es/template.php or /lang/en/template.php (each component has such folders, or create them) or /lang/ru/template.php (depending on how many sites are created in the admin panel), in these files the words are set like this
$MESS['TITLE'] = '...';
and in the template you can output like this
<?=GetMessage("TITLE")?>;
you need to create a second version of the site in the /es/ section, you can simply create the same sections and index.php files by specifying in them, for example, for the /es/index.php file
<? require ($_SERVER["DOCUMENT_ROOT"]."/index.php");
that is, the pages in all versions of the site will be the same (the same components will be launched).
The language change depends on which site is opened from which section, bitrix sets the global variable LANGUAGE_ID in which there will be the language code of the current site (specified in the admin panel), if we are in the /es/ section, then in the LANGUAGE_ID there will be “es” (if we are in section /ru/ then LANGUAGE_ID will be “ru”). So you can check the current language in the code.
If in the admin panel, in the information blocks, data is set that is displayed on the site or where they are collected from the site, then you need to create the same data for another version of the site (just checkmarks in the setting of the information block). Or to come up with something of your own, you can make a subscript to the code of the information block of the _es type, and in the code check LANGUAGE_ID to search for the necessary information block.
An example of how to implement it in the code can be found here https://github.com/ssv32/site-asisg.ru-web, this is not an ideal implementation, but you can follow the train of thought.
(in this case, the information blocks are the same, but the elements have a list type property that determines which language the data is for, and the code is filtered by this property)
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 to develop a Joomla 3.1 Template. The template should consist of a static header and footer, as well as multiple pages, all of which need their own styling. Further, the client would like to be able to add 'events' to a specific listings page. Customers should be able to book said events via a simple form.
Thanks to some really basic guides, I have the header and footer down, as well as some simple template options. However, I am now running into some problems;
How would I approach the content section? Ideally, a page would consist of multiple, editable sections. The client would be able to edit said sections in the backend without having to deal with or accidentally changing the layout or styling of the page itself. Since there are multiple pages, I obviously need different views/containers for each of them. Is this possible and if so, how?
Another problem is the documentation, which I found to be very lacking. Even google only got me so far (basic structure, index.php, templateDetails.xml and so forth). Are there any other resources I may have missed or do I really need to refer to other templates (most of which, obviously, aren't free) and use var_dump all the time?
Writing this, I just realized that I could theoretically build a template for every single page but ... that surely can't be right, right?
If someone could provide a basic outline or at least tell me how you personally would tackle a project like this, it'd be very much appreciated.
All the best
Edit;
I just found some video tutorials but since my bandwidth is limited, I cannot watch them. Please take this into account when writing an answer. Thanks.
I have only one word for you :
GANTRY :D
gantry-framework.org
Joomla revolves around menu items that point to components. For each menu item, you can assign modules to different positions within the template to create a unique page. You only need one template if you really understand how Joomla templating works.
Joomla has very good documentation here - http://docs.joomla.org/
Few things to remember -
Component - this is a type of content or app of sorts. A component will define what content is and how it is displayed. This can be anything from blog articles and categories to an event registration system to a message board or social network. Menu items generally will point to a view in a component.
Modules - these are used to display additional content around the component output. This can be a menu, or a login box, or a weather widget or anything else you can come up with. Modules can be assigned to or excluded from the various menu items on your site.
Plugin - plugins are used to change the final output on a site. They can be used to insert Youtube videos, or forms within content, or even to alter the meta tags on a page.
Understanding how extensions work is an important first step. Once you get how those work, learning how templates and template overrides work will give you most of what you need to know to build a basic Joomla site.
Is this a common task in your Drupal work when you're asked to create a custom admin section in Drupal for your content?
For instance, you have a few content types and user wants not only to view them, but to search using different filters, to add new items - all inside the same admin subsection.
In essence, this is classic search/grid/record screen/pages and while in typical Drupal distribution content management screents are kind of scattered around, I am talking about more organized spage, e.g. in which Grid (View) also has "Add new" link and you don't have to scroll to "Create content" menu which relates to a different section.
What is your experience and opinion in this relation?
I'm actually working on something like this right now where I work. We've built a custom module to solve Drupal's biggest problem of having unorganized content by organizing it in a nice tree structure. What we've decided to do is go ahead and create a whole new section within the admin just for managing content through this module (it contains a lot more functionality than just a tree structure). There were two big deciding factors when deciding to do this.
We knew we weren't going to be releasing this module so we didn't need to worry about integration with other modules because any such integration would be done by us.
The non-technical staff that this was presented to preferred this method over having several different admin pages with different pieces of functionality on each one, despite all the functionality being related. They viewed at as simply being easier to use.
The point behind my explanation is this: if it makes sense in your situation, then I'd say make either a new section or a new page with several tabs on it. There's a lot of deciding factors to consider:
Do I (or my) clients like the Drupal admin as is?
Do I need to worry about integration with third party modules?
Is time of the essence (this one is a big one)?
How extensible do I need the new admin page(s) to be?
Is upgrading to the newest version of Drupal of big importance (from 5 to 6 and later from 6 to 7 and so on)?
Many non-developers I've talked to abhor the Drupal admin and most content editors I've talked to or worked with prefer having a single admin page they can go to to manage all of their content. As a result, our setup is well received by our clients even though some within the Drupal community may not agree with it.
you can use views_bulk_operation module to show content (or users) to execute (batch) operations on them. in this way you get a sortable grid with search capabilities (exposed filters), pagination and the possibility to execute custom bulk actions. from here it's easy to add a link "create new" in the view footer. furthermore, you can use link as "local tasks" to organize views in tabs.
usually i use simplemenu for the admin backend and i hide the navigation menu in the sidebar for all but administrators.
Another option - much easier to deliver - would be to create a new menu only visible to the administrators - and dependent on the content displayed - with links to the pages for common tasks. Particular views, for example, or to add new content of the currently displayed type, etc.
I've got a client site that will have multiple "mini-sites" for individual web shows and one main site for the company that produces them. Each mini-site has it's own color scheme but has all the same menu items and/or content of the other site such as Photos, News, etc.
I can't seem to figure out how to ensure programatically that the stylesheet I associate with a given mini-site is retained for all interaction within the mini-site, until and unless a user leaves to the HOME page or changes SHOW from the shows menu.
It's possible that I would even use different virtual hosts for the mini-sites, so I want it to feel like they are completely different sites, but rather than maintain multiple instances of the CMS with the same content, they really are powered from one CMS.
I've thought about using JSession to manage sessions, and then grabbing the current mini-site name from session, changing only when a user selects the HOME page, or changes their SHOW from the shows menu. Alternatively I could try to have multiple templates and try to associate them to specific menu items, but that feels a bit ugly.
Does anyone have experience building sites like this in Joomla (or any CMS), and is there a best practice for this?
I think I will have separate sub-menus for each mini-site, so that Photos on each site is a link to a specfic gallery within the photos component, whereas Photos from the main site is a link to the main photo gallery.
I don't really get what you are trying to achieve from your question, but i decipher your question to be
You have multiple sites, [SITE A, MenuA, MenuB, MenuC] , [SITE B, MenuA, MenuB, MenuC] , [SITE C, MenuA, MenuB, MenuC].
2.
Each mini-site has it's own color scheme but has all the same menu items
Does this mean Menu A pointing to siteA, menu B pointing to siteB, MenuC pointing to site C, All menus are the same on each site.
why not have the same template on multiple sites with Different styles, such that If you have the same template, TemplateA, with styleA on siteA, styleB on siteB and styleC on siteC.
And if we are talking about multisites and styles. Are they on the same domain? i.e siteA.yourdomain.com, siteB.yourdomain.com, siteC.yourdomain.com I just learned this from a colleague, apparently you could actually use cookies by posting them to *.yourdomain.com and they will be accessible from all subdomains. Otherwise if the domains are totally differently it won't work for security reason. Something you might want to try
Sorry if i missed it, but maybe an taxonomical scenario will make more sense
Regards!