how to apply different layouts to different pages in Drupal 7? - php

I have converted a HTML page to Drupal template by using blocks and page.tpl.php file. Now I have another page that I need to convert and link it to the main navigation menu.
The problem is, that another page have completely different layouts and I don't understand how to create that layout and link it to the main menu. Is it really so complex? I found that it can be done by using panels but I am completely new in Drupal. I need a simple solution. Thanks if anyone can help me.

You can use some module like display suite or panels to create custom new pages with custom layout.
If you want to make all with code (and avoid database configurations), panels module is fully compatible with features (I don't know compatibility with display suite).

Related

How to make a dynamic wordpress page (custom control/page template box)

I have completed numerous wordpress template tutorials focusing on implementing multiple pages, and a custom dynamic navigation. The only issue I have is finding a source on creating a custom template box. For example, my goal is to customize the page template box following the mock up. The content placement is done in php, and designed in css. That way I dont have to add content in php but instead add it in wordpress based on my custom design. I have not found any source to achieve this. Does anyone have a source that displays how to create custom template boxes(the dynamic part)?
Links below is what I used to create my wordpress site
https://www.smashingmagazine.com/2013/05/migrate-existing-website-to-wordpress/
custom navbar for wordpress using bootstrap
I tried another source called Dynamic Page Templates in WordPress, Part 2 which suppose to explain how to create custom controls/template boxes. Following the link was unclear, resulting in not achieving the goal.
Thanks,
There are many ways to create a dynamic page in WordPress. I am sharing one of it. Install Advanced Custom Field Plugin and read its documentation. It allows page content to be changed from back-end (Its great for text/images). For areas where you want to user to choose whatever custom widget she wants to choose, add a widget area following any custom widget tutorial.

Adding/Importing a ready coded (AboutUs) page into Joomla

I am busy converting a HTML website into a Joomla temaplate, I got some help doing the home page (index.php), but now the menu items are not linking anywhere. I have a ready coded AboutUs.php page, which I want to important into Joomla and link to the 'About Us' menu item.
Can this be done in the similar way as it is done with the index.php file? Can I maybe upload the file via FTP and link it somehow in Joomla?
Any help on this would be much appreciated.
No it's not how joomla works.
You have to create the second menu item, link it with your content and add the extra modules that your "about us" page have.
If you don't want to do it like that you could create a new template and link each menu to different template but it's not a good approach.
If you are interested about the html part of the php site,
you can just create an article and paste html code in it (do not forget to set the editor in text mode).
If you have css, you may add it int the template's css file.
Otherwise, if you need php functionality, you need to create a joomla component.
If your going to migrate a site and use a tool like joomla i strongly suggest using it the way it was designed to be used. Otherwise theres no point.
When creating from scratch or migrating a site to joomla i would suggest firstly creating (or modifying) one or more templates to get the layout of you site; header, footer, logo, background, modules (eg. menu, login, etc) and component to load and so on.
You will have to recreate the menu items using the menu manager and apply your css to the menu module(you can download free menu modules or use the default one or develop one).
When creating a menu item you can select the template to be used and also what component you want to load (article, sitemap, blog, login, create user, etc...). An article is used to store html content which can be edited through the content manager although there are simple ways to add scripts to your articles.
If you want to add php to your content you have 4 choices.
Template (used to show content which appears on every page; this is where the html starts and ends and where the component and modules' positions are defined),
Component (this is loaded from the template depending on what menu item is selected),
Module (a very simple and easy way to add custom php and html code, can be loaded from the template or from components like in a joomla article),
Plugin (used when wanting to run scripts which dont have any visual content)

Wordpress Styling

I am new to using Wordpress as a developer as opposed to just using the dashbord but am struggling to understand a few things and would really appreciate some help.
For a site that does not require a blog - do you just create custom/specific page templates for each page that your site requires?
If so - presumably you code the content directly. But then how does the client edit their website's about page or any other page for example - because doing it through the dashboard isn't going to use the necessary CSS hooks without using classes, id's and HTML?
As a beginner to Wordpress - I can't see that posts are used on sites that don't have a blog, but am I correct or is using posts the way a client can edit content on their site, but just have posts styled to look like normal content?
Or am I wrong in thinking a company (I am starting as an intern at a web dev company that use WordPress) provides the tools or at least configures WordPress to enable the client to change content?
Any help getting me to understand the basic concept and way a developer would create a custom WordPress site would be much appreciated. Thanks in advance.
You can use page.php. In WordPress everyone create at least one custom template type to get wider design for custom pages.
You can refer here for more info.
Use Advanced Custom Fields with page templates. Say you are making an About page, call that template about and select that template in the backend editor. Once you save the page, the acf fields will show up and you can populate the content.
ACF: https://www.advancedcustomfields.com/
Page Templates: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

Drupal 7 theme "front" differs from other pages

I need a custom template for the 'frontpage' and a custom template for all the other pages.
What are the best practices to accomplish this?
Do I need to make 2 themes or can I use the same theme?
Create 2 template files:
page--front.tpl.php for the front page.
page.tpl.php for other pages.
For further reading, check out Drupal 7 Template Suggestions.
Don't forget to clear the site cache after the creation of each new template file.
Hope this helps... Muhammad.
If you're new to Drupal theming, try using the Devel and the Themer Developer module (http://drupal.org/project/devel_themer)
I would like to direct you towards "The Drupal Way" (do it with flexible UI-based modules) if you are not already familiar with.
I would approach this problem using Panels and possibly Views if you need to display listed information on the page (such as a news-feed or similar).
This gives a whole different approach to setting up your site's content displays and it is the general direction of the Drupal ecosystem.

How can I make part of a Joomla template editable via the CMS interface?

Title says most of it.
I have inherited a Joomla site and the client wants part of the main template (a feature-type box) to be editable via the Joomla backend.
I guess really it is a content item that never gets displayed as its own page, but as a part of all pages.
Is that possible?
Thanks.
EDIT: By editable, I mean as a piece of content, not as editing the template HTML. I hardly expect non-tech users to get things right in a WYSIWYG text editor, much less change HTML code that could screw up the whole site.
The Custom HTML Module allows you to create, edit, and display your own free-form HTML on a Joomla site using a WYSIWYG editor.
In your administration control panel you can find the "Module Manager" under "Extensions" in the drop down navigation menu. There you can create this module, choose a position in your template to display it, and then select what sections of your site the module should be displayed on.
You want the content items module.
Content Items Module
This way a user can add content as normal using the standard content pages, but you as the developer can set the module up to show that content as a module only. You have a LOT of choices with the above module too, you can set individual, category, intro, main all that kind of thing. Dont link to the page or category and it wont be shown on the main site, just in the module :)
The joomla extension directory is full of great things.
Good luck
You can use a special component for Joomla to edit templates, any part of template, any Tag. See dewem template editor component
Joomla templates are always editable via the backend. Just got to Extensions->Template Manager->Select the template you're using to edit it->and then up in the toolbar there will options for editing the html or the css as well as many design (look) options over on the right. That is in Joomla 1.5.

Categories