Am new in drupal. so am work with the latest version Drupal 7. In that how can i differentiated between the front page and other pages. i have page.tpl.php file only. am using marinelli Themes.
Thanks in advance
Chek out Drupal 7 Template Suggestions to see the naming conventions for different template types.
In your case you want 2 separate page template files, one called page.tpl.php which is the default, and one called page--front.tpl.php which will only be active for the content designated as the site front page.
You can create a page-front.tpl.php that will be used for the front page. Remember to clear your caches after you create this file.
Related
I am having serious problems customizing my views template to displayblog entries in drupal 7.
please anyone with knowledge of what can help me please reply. i have gone through a couple of drupal documentations but no luck. my field.tpl.php seem to be the only template that actually affect my displays even though i have views-view-field.tpl.php, views-view--blog.tpl.php in the template .
In the view settings, under format, show, make sure you have fields selected, not content.
Under advanced, theme, click information to see which template files are being used, and click rescan if necessary.
If you have created or edited a view, please check under FORMAT section this should be Show:Fields and under Advanced section look for Theme:Information and click onto this, there will be a popup with all possible templates for the display plugin and for the style plugins. All field tpl will be available here those are exists in views fields, you can find your own and use as per your requirement.
When you edit your view open "Advanced" section on the right (collapsed by default) and click on "Information" from "Theme: Information" (last option in that section). There you can see what templates are used (bolded ones) and what could be used instead. You can even click on template description at the beginning of the line, and code will be displayed. Grab that code (copy) and create new template file with one of offered names. Place that template file in your theme and clear the cache. Now you can modify template by your needs.
Also, you even don't have to use all that hierarchy (even that's desirable), but you can i.e. find the template file that are looping over the rows and inside that loop put your html, so lower rank templates won't be included (i.e. template that iterates over fields or even over rows) . Again not so clear solution, but it works for me. I prefer having less template files and I know that nobody will work on that theme except me.
I need to add a rendering to all the pages. I thought adding to a Page Basic template that I have and is being inherited for all the page templates.
These page templates have different renderings and layout so the presentation is overridden. On top of that, authors have been adding more renderings to the pages themselves.
Any ideas on how to add this rendering to all the pages?
Thanks
I would use sitecore Powershell to accomplish this. After traversing the tree you could add the rendering using the code in this link.
Just make sure to backup you db, just in case!
https://blogs.perficient.com/microsoft/2016/06/sitecore-powershell-add-rendering-to-item/
I am very new with Joomla, and I have to create a template for joomla 3.0 based on a design given.
I have read a lot of manuals and tutorials about "simple joomla" templates that explain how to organize the directory structure, xml file, index.php and so on.
But I don't see where we can define different layouts for different sections of the website, for example:
Layout for the home page
Layout for articles listing (on search for example)
Layout for the article itself.
I am sure there must be thousands of tutorials regarding that point, bu I simply cannot find it.
Thanks for any advice.
I think one of the concepts you may be missing is "Template and Layout Overrides".
Components (the elements of Joomla! that create the main section of any given page) control the layout of any of their views. To change these a template need to create a matching override for the specific view.
A similar process is used for "Modules" the smaller elements of a web page (e.g. side-bar advertising or widgets).
Have a read of these articles:
How to override the output from Joomla! Core
Understanding Output Overrides
Converting a template for Joomla! 3
You may also want to look at the "Joomla 3.x Template Overrides Example" that You!Joomla created a while back.
Finally given that Joomla! 3.0 is a Short Term Support version (and 3.1 is due any day and so on) you will probably be advised to use the "Template Overrides in Joomla! 3.0" forum for specifics.
If you look in Isis you will see an example of using conditions to change he layout, that is how the control panel is so differen than the rest of the admin. You can either do it all in one file or you can have separate files
I'm working on a Liferay 6 project, and part of the project is to create a new layout template to be used for the entire site as the default. Liferay's own wiki is very sparse on documentation about layout templates, and I haven't had better luck with Google searches or even here on SO.
I did find one article ( Liferay - Layout for each pages ) that sort of answers the question, but it seems like it might be overkill. In that question, the goal was to change the template based on the page, so the answer was to create a Hook and use that to set the template on the fly as needed. Here, I just want to have this custom template be the default for all pages, all the time, which is why I think the answer to that other question might be more than is really needed.
If anyone has the answer to this puzzler, please let me know. Thanks!
-- JLM --
OK, I've figured out my confusion. Liferay has two types of layout templates -- templates that are part of a theme, which is one type of Liferay project, as well as actual layout template projects themselves.
The templates in a theme are where you set up the overall page layout for the site. The main page template, named portal_normal.vm, is a full web page with an <html> tag, a <head> and <body>, etc. Other templates in the theme are usually page fragments.
A Layout Template, on the other hand, is only for laying out the portlets in the main content region of your page (which is defined by tags in your Theme's template files). It is always a fragment and can only have <div> elements or a <table> for laying out the portlets.
Fortunately, this actually makes answering my question very easy, at least in the context that I needed. Per Liferay's documentation at http://www.liferay.com/community/wiki/-/wiki/Main/How+To+Change+Liferay+Default+Theme :
Note: As of 6.x, you cannot just use the theme id specified in the liferay-look-and-feel.xml. Instead, go to Control Panel->Plugins Configuration->Click on theme of interest->note the Plugin ID and use that [as the value for default.theme.id in portal-ext.properties]
I hope this helps some other people trying to figure this out!
I am very new to Typo3, and I have a very basic (not to say dumb) question: is it possible to have multiple page templates or can you only have one template?
What I need to do is have different templates call different scripts because apparently having the same template call all of them seems to create conflicts.
Thank you for your help!
Jane
Using TypoScript, you can include any number of scripts in your template.
You can even imagine the following page tree:
-Home
--Page 1
--Page 2
---Page A
---Page B
--Page 3
You can set a certain template for the homepage, and it will apply to all pages. But you can set a completely different template for page 3, and it will only apply to that page. You can also apply a slightly different template to page 2, overriding specific values (page background, CSS inclusion, etc), and it will apply to Page A and Page B as well.
yes, you can have many different templates on a site. Actually each single page can have its very own template. You might be interested in checking out templavoila since its very graphical and once you got it set up, you can easily change between templates within the Typo3 backend.
Tutorials
An alternative would be to use the original TypoScript templates which is not difficult yet requires a bit of TypoScript understanding.
TypoScript Templates
In any way you can chose between different templates.