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
Related
Currently working in SC7 where I have implemented a kind of scaffolding so that editors can add an article to a page and add sections and paragraphs under it. You get the idea, html5 stuff...
Now, the problem...
Editors are working in Page Editor:
Suppose you make a new page, and add an article. It has a title, hero image on top and an introduction. You choose to create new content and I save it in an ItemBucket called ContenStore where I store all my articles, sections, paragraphs... The SC7 way to use the search if they want to re-use any of that content.
Suppose my editor creates another new page, and he wants to re-use a section from the content store. He will find the section but when he has placed it on the page, non of the paragraphs that were on the original section show up... Of course not, since I guess the layout details are saved on the context item level and not on that section level...
Has anyone tackled this problem before? A sublayout (or rendering) should be able to remeber what layout details it has, so that if you re-use it, all the items it had originally are put in its placeholders again as well, and this recursively of course...
Any thoughts welcome...
Erwin
The problem you describe is not new to Sitecore 7. You would have the same problem in Sitecore 6, you would just have to go through the additional effort of keeping your content organized. This is a fundamental limitation of Sitecore's presentation framework.
I have worked around similar problems before by using Presentation Inversion of Control. (I should probably write an update for that since the rules engine approach no longer works)
I believe that Cognifide is doing something similar with the "Composites" in their Zen Garden, but instead of using a dummy layout they use an empty layout so any item can be opened as a page. Then they added a custom experience button which navigates to that non-page content item within the page editor. (Note that this is speculation based on a brief demo that I saw).
Thomas Eldblom also blogged years ago about what he called Composite Layouts. It's similar to PIoC, but puts the presentation settings on a special rendering type.
In short, there are ways to achieve what you want, but they all involve custom development and will require extra attention to maintain a smooth page editor experience.
Im developing an e-commerce with Joomla 2.5 using a template which has a slideshow embedded (not a module).
I want to create an article where the client himself can easily upload images and their descriptions and urls for the slideshow.
I've managed to load a file uploader module in an article and it works. But I don't know how to change the descriptions and urls.
The descriptions and urls are template parameters and I don't know how to set them from the article.
The params.ini file in template folder is blank.. The .xml shows the 's for them but not their current value.
You are getting two functions to work, but you're missing the whole logic that links images to pages, and assigns them names, possibly manage a little security.
Why do you want to build this from scratch? You'd be so much better off with a ready-made, free, tested and supported CCK (e.g. contentbuilder, k2, sobi, zoo just to name a few).
How can I include a page from magnolia into a magnolia template script?
In the template script with I can access data from a specific page, but how can I load that page into the template?
Let's say I have 2 pages each with its own template. Page 1 contains in its tree page 2. I want to include in the template script of page 1, page 2, but doesn't work.
Thank you very much :)
UPDATED
What I actually want to do is include my header in all of my project's pages. But I don't want to put it as a paragraph, because if I ever want to change my header, I'll have to edit all the project's pages.
So what I try to do and I don't know if this is the correct approach is to create a page template for the header. This template won't include any , or css, it's just the code for the header.
The next thing I want to do is create a page in magnolia with that model to be the header.
Next I'd like to include the page I've just created in my main template model for the project, but I can't figure how to do that.
I am new to Magnolia cms and initially I tried creating my demo site using stk. The only problem was that I couldn't use jsp as a scripting language, or at least I couldn't find any solution on the internet. I don't really know freemarker, but that's not really a big problem. I'm really reluctant in using freemarker because maybe in the future in a more complex project I might need some features that freemarker doesn't support, but jsp does. I'd like to build my site using jsp if that's possible with magnolia.
I'm sorry for this long update, but if anyone has any suggestions on what a best practice could be and if I could implement what I want in jsp I would be really grateful.
Thanks again for you time :)
If you're using the STK then see this guide on content-reuse.
If not have a look at the cms tag-lib, especially the tags cms:loadPage and cms:setNode with which you can get a piece of content and set it as a JSP/JSTL variable and then render it using cms:includeTemplate.
A common scenario is to 'inherit' content from the parent page, the header is an excellent example of this. What you do is for an area you walk up the content hierarchy and render everything from the parent pages in their area with the same name. This way the header which you've only added to the top page is included in all its children.
Another option is to a have special page which simply holds things to be included in other pages. Like header, footer and banners that should go in the side pane of some pages.
Including a page within another page doesn't really work. Page 2 already has its own <html> tags, its own <script> tags, and its own CSS, so including it wholesale into another page just simply doesn't make sense.
You do, however, have a couple of options:
Use an iframe. This will allow you to include the entirety of Page 2 in a region of Page 1.
More recent versions of Magnolia will allow you to render an individual paragraph, which you could then include in another page. (For example, you can see a single paragraph from http://demopublic.magnolia-cms.com/demo-project/about/subsection-articles.html at http://demopublic.magnolia-cms.com/demo-project/about/subsection-articles/article/main/0.html.) This requires knowing a bit about the way the data is structured, but is a pretty useful way to be able to selectively extracts bits of a page.
You can use the Magnolia API in your model class to pull data from sub-pages, and then make it available to your view template. This is the approach the STK uses to build teasers that include content from the pages they reference, and is probably the most powerful and flexible approach, but it does require actually writing some Java code. (See http://documentation.magnolia-cms.com/templating/stk/templating.html and http://documentation.magnolia-cms.com/reference/templating.html for details of how to use this approach.)
(Added after question was edited) The footer functionality that's included with the STK does almost exactly this. You might be interested to take a look at that and see how it's implemented there.
Hope that helps a bit!
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'm a little confused with the way Magento implements web pages, and I'm hoping someone here can help me out.
I've figured out how to adjust themes and templates, etc., but I'm wondering how I implement content with them.
There is a disconnect in my understanding of how to put content into a page. Is this done with the layout and template files, or is this done on the cms page?
I've been searching for tutorials, etc., and I'm having trouble finding them (maybe I'm using the wrong terminology), so if you know of examples or anything that might help, I would really appreciate it.
Thank you in advance for your help!
Magento design/template is a broad question, which may appears tricky at first, but so logical and powerfull once you get to know it.
In a nutshell, the .xml layout files are responsible for defining the content, and the phtml (in relation with their Block classes) actually render the html. Everytime a page load, all the layout files are parsed to retrieve all the blocks which have to appears in this particular page.
The content loaded in each page is defined by the handles in the layout files, which correspond to the module/controller/action. For example, the content of the customer's account index page (which is the result of the index action, of the Account Controller of the Customer module, see the logic of the handle's name) is defined by:
the blocks/layout defined in the <customer_account_index> handle of app/design/PACKAGE/TEMPLATE/layout/customer.xml
the blocks/layout defined in the <customer_account_index> handle of all other layout files (I'm not saying that all layout files have a <customer_account_index> handle, but those who have it, like poll.xml, will insert their content)
the blocks/layout defined in the <default> handle of all other layout files, that's why it's called "default" :)
When you say:
is this done on the cms page?
I assume you're refering to the cms in the admin: this only take care of the content block of the static pages of your store. And the rest of the page is still defined by the xml (the page.xml handle of the cms page's layout (1 column, 2 columns-left, etc...) handles like <default>, <cms_index_index>, etc...) But even there, you can modify the layout by putting content in the proper textareas.
Here are some interesting links to understand the magic of Magento's layout:
Demystifying Magento’s Layout XML
Magento for Developers: Part 4 - Magento Layouts, Blocks and Templatese
No Frills Magento Layout by Alan Storm
Designer's Guide to Magento
HTH