How to have custom sidebar content per article in Joomla? - joomla

I'm in the process of porting an existing website to Joomla. Most pages of this website consist of a main content area and a sidebar containing additional items relating to the main content, such as (in-page) links, images, additional information, etc.
In Joomla, the main page content would probably be an article, but I'm not sure what would be the best way to create the sidebar content in Joomla.
Examples of pages-with-sidebar:
http://www.aikikan.nl/en_watisaikido
http://www.aikikan.nl/dojo?id=2
I'm creating a custom template for this website, so any solutions that require modifying the template are fine as well. What would be the best way to set this up?

Keep the content of each sidebar in an article and then assign it to a module by means of the article-as-module extension. You can then control the scope for each module (i.e. choose menu postions for which it will be shown) in the admin interface.

There is an extension called meta mod which is perfect for this sort of thing. It allows you to show modules based on any condition you can evaluate with PHP

Related

CS-Cart Menu in custom template

I am making a template in CS-Cart by including the needed tpl files directly into my html where needed. But what I'm not sure how to do is include the main menu.
eg.
{include file="common/search.tpl"}
I've created a custom menu, which currently contains two categories and two pages, and called it 'Top Nav'. How do I include this in my html template file?
You can do this, but you'll still need to use the block manager.
You can create a block for your menu, and manually insert it by following the tutorial here: http://forum.cs-cart.com/topic/29828-a-simple-way-to-add-any-content-on-any-place-on-template/
Though, as Alexander points out, it's not the recommended way to do it.
You should consider to start using the built-in block manager.
A block is a "widget" that can be put into an any place on the page using GUI at the administration panel. There is no separate template for that, blocks are being rendered dynamically - you can't just include it into your template.
So you should create a block that will render the menu you've created and position it on your page layout.
Check out the documentation to learn more: http://docs.cs-cart.com/4.3.x/user_guide/look_and_feel/menus/index.html

How to create a single page vertical scrolling site in Joomla

I can create a standard Joomla template in my sleep, but recently I had a client come to me who wants a vertically scrolling, single page site. I whipped up an HTML/CSS mockup that functions beautifully but I have a question re: converting it to a Joomla template:
Do I just create a single article in Joomla that contains all of the content for the single page, and then create menu items that link to the section divs?
Many thanks,
Cynthia
yes I think that good , also you can make all items in "index.php" in template folder and make menu items link to divs by "#" plus ID .
you can add all items you want as module and you can use component in modules plugin lik :
http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/embed-a-include/18121
Hope that help you
You'd be better to insert the content via creating a bespoke module or component - putting code in the WYSIWYG area kind of defeats the point of using a CMS at all - someone with no coding skills has to be able to update the site and not accidentally delete the layout.
I'd perhaps question why it needs it to be in Joomla at all, though. It doesn't sound like it will be benefiting from many of its features.

Joomla 1.7 with Virtuemart 2.0 – How do I change template for a homepage and other subpages

I am a newbie to Joomla 1.7 & Virtuemart. I have used many CMS so far and in Joomla I need to do very common task. I need to have different layout for homepage, for product list and product details and so on. Every single page is generated from index.php which is in *joomla root/templates/my_own_template/* folder.
And one more question. Is there any Virtuemart 2.0 or Joomla 1.7 documentation? Because what I could see is that the versions are really different from old ones for which most documentation are written.
Thank you in advance for answers.
You're probably not going to find much documentation yet since that is usually the last thing that a developer does once the code is out and tested.
As for changing templates, you don't necessarily need to change templates to have different layouts. First, VM has several different theme files (theme is a VM template) that render the various pages. There are already different layouts you control in the admin. You can also change a particular page by adding or removing the various modules from pages. You can associate a module with all pages in the site, a selection of pages, an exclusion of pages, and no pages at all. Components like Advanced Module Manager give you even more control over where and when a module displays. A properly coded template will have collapsible module positions. So a page with no modules in the left column will not have a left column.
Lastly, Joomla 1.7 also allows the use of template styles. When you install a template, it creates a default style. You can duplicate and edit that style, then assign it to various menu items to achieve very different looks from one page to another. http://docs.joomla.org/Help16:Extensions_Template_Manager_Styles_Edit
Brent's answer is good – he's right that the look of a page can be determined by which modules are assigned, which VM layout is used, and by assigning different Joomla Templates/Styles to different menu items.
One issue that arises a lot with complex components like VirtueMart is that it can be awkward to assign different templates (or modules) to different menu items. This can mess up your menu structure, and there are times when VM will decide on a different menu item to display something rather than what you thought it should. So that messes up the modules and templates/styles. This is part of the down-side of having a menu-item-driven assignment system.
AMM is good for assigning modules to different pages independent of menu item - as is MetaMod (which has explicit VM support).
For assigning templates/styles to different pages in VM I would suggest Chameleon. Chameleon has form controls for selecting lots of different factors about VM (e.g. all the sub-page types, category of the item, cart contents and more) and you can use any of those factors to trigger a certain template/style. It can also trigger other actions like adding CSS/JS to the page, removing arbitrary menu items, switching the home page, etc.
So ultimately, using Brent's techniques and with Chameleon, MetaMod and/or AMM, you have a huge amount of control about how individual pages in VM look.

How to add js to a joomla template

i need to add js to a specific page in joomla. How do i do that? I cant find any option to edit the html of each page, since i also have to add some little html. How does joomla do that? i can assign a template for a specific site but then you would have to do each change twice...
I need to add a javascript file and some html to one specific site. i read the wiki and googled but i dont get it...
The reason you couldn't find a page to edit is that there is only one page in a Joomla site that builds all the other pages based on the URL, menu ID, and other parameters passed in the query string.
If you only need the javascript on a single "page" then there are a couple of ways to do it depending on where the content needs to be.
If it needs to go in the main content area (the component position) then you should get an extension that allows you to put javascript inside a regular Joomla article. Then you can put what ever code and HTML you need in the article and link to it with a regular menu item.
If you want it to go in a module position, then you can simply use the Custom HTML module. If you turn off the WYSIWYG editor editor, you can put the javascript right in to the content area of the module. It does require the editor to be off though, otherwise the code will be evaluated and you will lose what ever you had in there. You can also limit where the module displays under the menu assignment selection.

Making a different type of home page in Orchard

I've just started with the Orchard CMS and I can see that I can create a page and have different widgets on them, but I need the homepage to have a different layout.
I'd like to have some sort of different cshtml file for the homepage, but I can't seem to work out how to do it from the documentation. I also need to have four text areas on the home page that aren't on the main page.
Can someone who has done this point me in the right direction?
You should use designer tools module if you are using Orchard 1.1 +. Just search for Shapes in the admin and install the tools. Then you can create Alternates by reviewing the shapes in-browser.
In your case you should be able to create a view with the name: Content-url-homepage.cshtml
This may help you, it's a post I found about making your own themes and is a fairly simple example but covers what you are looking for:
http://www.nogginbox.co.uk/blog/theming-orchard
/Views/Content-11.cshtml
I wanted to display the content on my
homepage slightly differently than
other pages. My homepage has an ID of
11 so I was able to reference it with
a file called Content-11.cshtml. I
could also have created a template for
all blog post content using a file
called Content-BlogPost.cshtml had I
needed to do so.
You can try this to vary the homepage layout: http://weblogs.asp.net/bleroy/archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx
Orchard 1.1 will also give you a homepage alternate out of the box.

Resources