I am developing a site for a friend of mine. The startpage should only contain her name, a slogan and a link (something like Enter Site) to the next template. I can't figure out on how this can be accomplished.
So, briefly, the startpage should NOT contain menu items, the next template which would be called from the link "enter site" would contain ALL the menu items and the relevant information..
I have searched thru various discussion groups, but can't find an answer. Site is being build around Joomla CMS 3.2.3
URL is (for development purposes) www.webmatix.be/nikie
Can someone throw in a helping hand?
Tnx + b rgds
Gino
there are various ways to achieve this. I guess that Joomla wants you to assign a different template to the home menu item. You can do this in extensions - templates. If you click on the template there is an option somewhere to add it to menu pages. So in fact you have to make 2 templates then. This is not what I prefer.
I always do it using PHP in my template's index.php. I ask for the menu's alias and then fix the template accordingly:
<?php
$currentMenuItem = JSite::getMenu()->getActive();
$alias = $currentMenuItem->alias;
?>
<?php if($alias == "home"): ?>
<div>homepagestuffs</div>
<?php else: ?>
<div>normal template with all kinds of modules and components bla</div>
<?php endif; ?>
This gives me the flexibility I want without having a second template to worry about.
Ignoring for a moment the negative effect on user experience, why not just create an index.html in the root directory of the website and only if necessary adjust the .htaccess to promote it before index.php for just that directory.
e.g.
DirectoryIndex index.html index.php
You can make a HTML file like index.html and do what ever you want in that.
Place index.html in the root folder of your host.
Then make a folder and give it name like "dynamic" or whatever you want.
Copy the whole Joomla Website files in that folder.
The URLs would be like:
http://www.example.com/index.html
http://www.example.com/dynamic/index.php
I've one use this solution in rasoularam.com
The first page (landing page):rasoularam.com, pure HTML, Javascript, CSS
The other pages: http://rasoularam.com/dynamic/index.php/%D8%A8%DB%8C%D9%88%DA%AF%D8%B1%D8%A7%D9%81%DB%8C-%D8%B1%D8%B3%D9%88%D9%84-%D8%A2%D8%B1%D8%A7%D9%85.html
Do't worry about unfamiliar characters in the url, they are uni-code urls, written in persian.
The benefit of this solution is that, because of using pure html page as landing page, the first page will load fast, even the host does not have good hardware configuration.
The only problem is the administrator section's url would be rasoularam.com/dynamic/administrator
Related
I am working on a phpbb design. I have a local install with a duplicated database of the original site. I have no access to the administration panel since I am not an admin on the original site.
Changes made to the CSS would not show on the page, so I edited the file /style.php and forced recompiling CSS by setting $recompile to true. That solved the issue.
However, I am now trying to make changes to the HTML, because the phpbb semantics is one of the worst I have ever seen, and most elements don't have classnames.
When making changes to template files (let's say to the "prosilver" default theme), those changes won't show on the page. For example if I add classnames to certain elements, those classnames will not appear on the page.
I know that the problem comes from phpbb caching templates, and I tried forcing recaching by setting $recache to true in /style.php, but that didn't work.
Thanks for any help !
Kind regards.
If you have access to the server via ftp or your hosts control panel, go into the /cache directory and delete everything EXCEPT .htaccess and index.htm. This will have the same effect as clearing the cache via the ACP and will force the templates to recompile.
We used the smarty template engine as the framework for my site. I am trying to add static pages to the site, but I cannot get the new static pages to appear.
Can someone please tell me what I need to do to get a new page to appear?
Here is an example. My About Us Page is located at www.domain.com/about. This page is called about.tpl
I want to add another page called 'history'. The page is saved as history.tpl. I FTP'd the page to my server, but when I go to www.domain.com/help it does not appear.
I feel like I'm missing some sort of important step to get the help.tpl page to appear.
Keep in mind smarty is a template engine for PHP. You can't just upload a template file and expect your homepage to show this without any reference, you at least need a few lines of PHP code to load and display it.
The basic setup for using a smarty template is something like this:
<?php
require_once(YOUR_SMARTY_DIR . 'Smarty.class.php');
$smarty = new Smarty();
$smarty->display('your_template.tpl');
?>
If you have some script like this, call it maybe about.php, upload it, then go to www.yoursite.com/about.php, the template your_template.tpl will be displayed, if configured correctly.
I am designing a very small website using basic HTML. I usually use a CMS but it has been a while since I did just HTML files, I was wondering if there was some sort templating where you can have like areas like a "Master template" and when a section is changed or added to the rest of the HTML pages that have those sections change with it. Like a common header and footer so I don't have to make the changes in each page if I need to make a change to an element.
I am using AptanaStudio 3 and was wondering if there was a feature like that as there is in Dreamweaver. I don't have Dreamweaver installed on my new computer, so taht is not an option.
Thanks in advance
You can try server-side includes (SSI): http://www.htmlgoodies.com/beyond/webmaster/article.php/3473341/SSI-The-Include-Command.htm
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 want to create a page in Joomla that displays only one specified module on a page and nothing more. I was trying to insert module in an article but it's not working because plugins are also adding content to an article, and I don't want to turn them off. MAybe I should create a template with a new position, and override default template on that specific page but maybe there's a better solution. Any ideas?
Joomla is coded to either expect an article or the output of a component on every page. I don't completely understand why you can't just insert a blank article with the {loadposition module_position} code unless your plugins are automatically generating content for articles. I'm used to plugins that only work when their plugin code is added to an article. Anyway, assuming that your plugins are automatically adding content to your Joomla articles, then the simple solution might be to add a new component like Zoo and use the "Pages" app to create a blank/no-title item that contains the {loadposition xx} code, then link your menu item to that Zoo item.
Have you checked the parameters of the article? Those should allow you to turn off the title, author, icons, date, and other elements that may be appearing.
I think it can be possible by this condition in index.php
countModules('condition')) { ?>
do something
do something else
you can put what you want in this module and according to this condtion you have to only insert module name in countModules('your module Name') followed by bhe code in the braces. and for rest of pages you can put your code in the else part.