joomla module to create multiple pages - php

I have a need for the ability to create web pages that are image galleries and link them to other pages/galleries.
For example, each page would be a gallery of photos, and I would like to be able to link (forward and backwards) to the other gallery pages.
So, Project-1.html -> Project-2.html <--> project-3.html <--> project-4.html
Where each "project" is a gallery of images.
Now, I can of course make a module to make/edit an image gallery, but ... how do I also allow for the creation of the other projects? Which are pages?
Should I be looking into making articles which contain modules?
Or, do the modules themselves already allow for something like this?
Or, should I just make one page/one module that does some lazy loading and completes this task on one page (that appears and behaves like multiple pages)?
If I were to do this now - with my current Joomla knowledge - I would do it on one page and use lazy loading; I'm essentially asking what Joomla offers, on this front.

Simply create an article for each project and add the gallery inside the article you want (if you want to use the modules for gallery you can embed it inside the article too).
Then if you put the articles in the same category you can browse them back and forth through the default buttons.

Related

What is the best way to create page in Drupal 8 so that I can then add these posts with images?

I have a Home page on the Drupal website (such as is created after installation), but I still need to create this page:
What is the best way to create a page so that I can then add these posts with images?
I am just starting to learn Drupal and have heard so far about such ways of creating pages:
1) in admin toolbar: Content / Add Content / Article
2) in admin toolbar: Content / Add Content / Basic page
3) in admin toolbar: Structure / Views / Add Views
Which one should I use? Or maybe there is some other option that I don’t know about?
P.S. At the moment I am more interested how to create empty page on which I can then add posts later, and adding posts it is another question.
Welcome to Drupal.
Drupal ships with the default theme which won't look nice but it does its job in the right way. Now if you want to create a better UI/UX obviously you should create a new theme. But before that make sure to read and understand the concepts behind Drupal. Drupal docs are your first friend.
Drupal Documentation
Drupal considers everything as nodes and that's how Drupal got its power. As you mentioned, Articles, Basic Page etc are called content types and they can be used to create a particular type of content.
Now for your purpose create a new content type and add the fields you need. From the image above I can say your content type needs Title, Image, Category and Date. After creating content type you can create as many contents as you want under the content type you just created. Consider each card in your image as content.
Now you can use a Drupal Core Module Views, to perform DataBase Operations without writing single code. Yes, you can select fields, sort, order etc with Views UI and display it in a page or a part of a page (Block).
I would say just try this out in the default Drupal theme and when you understand how this works, you can start creating your own theme for your project.
Theming Drupal
There is a lot of resources available. But you have to make sure what you are asking is whether you actually need. It will take some time, but it worth.
To build layouts for homepages on Drupal 8 you best friend is https://www.drupal.org/docs/8/core/modules/layout-builder
To build the content blocks inside your home page, you should start creating nodes on a node content type to hold your information. For instance: news content type, with a title, a body, a date, and an image.
For every node type, ex. news, work on the preview display, full display, and any other display which makes sense. These displays can be used later in the Layout Builder directly or in Views, referenced below.
If you wish your list to be dynamic, such as the last 10 entries are shown first, then use a view to hold the content sorted and filtered as you need.
In a nutshell.
Create a content type for your article/news.
Modify the displays of the content types to have at least a summary and full view.
Create the content itself to have something to see.
Create the view (block) to filter and sort your content.
Create a page layout (this makes sense for landing pages) which places your new view and any other content you need in any disposition.
This is roughly what I would do. The steps described above contain many intermediate steps. If in doubt, check the docs.
I hope that helps!
First, decide what will you display on that page. Is it content in some existing content type (article maybe) or you want to crate new one for this purpose.
If you need new one then create it (Structure -> Content types -> Add content type).
Then check what fields will you need. I.e. image, some description text. Add missing ones.
Create few nodes (pages) in that type so you could work with them.
Then for displaying you should crate a view (Structure -> Views -> Add view). It can be a page view (you are displaying only that content on page) or block view (this is just a block among some others). If you create a page you could visit it and if you create a block you have to add it to some region to appear on page (Structure -> Block Layout).
Inside your theme you should create templates for this page/block. Turn on twig debug mode so it will show you hints - what templates are used and how can you name yours to override default ones.
Adjust CSS to make it look like you want it to look.
Find some tutorial(s) for the details
Previous answers have given the flow of the work you should go through, I would like to add some resource that might help you achieve this.
Creating content type and fields: https://www.drupal.org/docs/administering-a-drupal-site/managing-content-0/working-with-content-types-and-fields
https://www.drupal.org/docs/user_guide/en/structure-content-type.html
View and View modes: https://www.drupal.org/docs/user_guide/en/views-concept.html
https://www.drupal.org/docs/8/api/entity-api/display-modes-view-modes-and-form-modes
Handling block of the view: https://www.drupal.org/docs/8/core/modules/block/overview
Feel free to ask if any further explanation is needed.
Thank you

Creating custom joomla pages

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.

solving templates conflicts between joomla sites that use the same db

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.

developing module with drupal

I have a website which is up and running on drupal. Its product based website. I developed by creating my own tables and writing php code using php filters. I never used module concepts. Since the site is running well, so i am thinking to move to module concept. so wanted some help here, like how to do it.. i have gone through module development concepts also.
requirement.
1. Admin should be able to create new products like Mobile, Camera.
2. He should be able to define product properties and properties for which user will rate on.
3. Admin/ second admin should be able to create new sub products under products like mobile - nokia 8850 , nokia 9980 where he enters details of product properties also.
4. A listing page for all the sun products under main product. and from listing page we go to to main sub product page where user rates the product.
My confusion : should i create a new table or drupal takes care of all the requirements. and how do i start with it.
update : clear picture of requirement
ex :
1. 1st i add a product "MOBILES"
2. Then i add properties for this main product.
3. Then i start adding sub products under MOBILES i.e nokia 1100, samsumg 2200 and etc.
while adding sub products, in this page it gives me a text box for all the propeties i defined while creating the main product MOBILES . So is this possible using CCK.
You're right to consider using modules and following the "Drupal way". Use CCK + Views and Drupal will take care of the table maintenance and querying for you.
As already mentioned, you will need to get familiar with the CCK module. This module will allow you to create new "content types", which in your example would be the different product types and their attributes. Here is a good overview video on CCK. With CCK you can define new content types and Drupal will create the basic content creation forms for you and hide spare you from all the database details when you're working with it.
The Views module is essentially a query builder and will allow you to create views of your content. There are all sorts of related modules that can help you render your data as charts, grids, lists, slideshows, tables, etc.
There is a slight learning curve but once you get past it you'll be able to build new things pretty quick.
Update: Just another thought, if you are really needing to create some kind of classification system you should look at Taxonomies.
It sounds like you could do all of this with modules, without needing to do any php coding at all. Check out (if you haven't already) cck, views, and fivestar.
In response to your update, sounds like CCK and Node Hierarchy should do everything you need.

What is the best practice/approach to programatically sharing content between sites in Joomla?

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!

Categories