How to add js to a joomla template - joomla

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.

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 attach ItemID to joomla footermenu

I am don't know joomla, but familiar with wordpress & PHP & wants to change some links in my clients existing project.
I have a menu which is a link like http://www.smarti.com.sa/index.php?option=com_content&view=article&id=6&Itemid=107 while calling it from top navigation menu.
developer has taken same link in footer but it redirects to
http://www.smarti.com.sa/index.php?option=com_content&view=article&id=6
Now i want ItemID in footer link also.
My Site URL is http://www.smarti.com.sa/
In that please Products > Microsoft.
Please give solution
As per your post, Your menu link for now is : http://www.smarti.com.sa/index.php?option=com_content&view=article&id=6 .
But, you want to use this like : http://www.smarti.com.sa/index.php/your_menu_name.
You can use aliases of menu links.
You can find aliases here, When you create/edit a menu link from backend of joomla you can see an alias associated with it. You can also find Aliases of menu link from grid screen of you menu type.
For showing Menu in front end you have to create CUSTOM HTML module, You can find how to create Custom HTML module here : http://vinaora.com/2012/09/how-to-add-custom-html-to-your-joomla-site-2/
Now, How can you find HTML to write in thst Custom HTML Module? So, for this you can go the page of front-end where that menu is visible. Now prss CTRL+U, you will see the HTML of that page. Here, you have to find the HTML of those menus.
In this HTML, you will find the links like : index.php?option=com_content&view=article&id=6
Now, you have to replace these links with index.php/alias_of_your_menu.
Now paste the edited HTML in Custom HTML module and save it by selecting a proper Position.
You can use joomla menu module in the footer.
Joomla also has the option to display second level menu items in a menu module.
To do this:
Set the Start Level to "1" and the End Level to "1".
That's all. Good Luck.

Remove main menu and header from a page in Joomla

I want to create one or two pages on my website with no header or main menu or anything - i.e. just the main content.
I am using the Acacia template from Rockettheme. The main menu and the logo are not published as modules, so I do not know how to remove them from specific pages.
Is it possible to create a separate layout or something?
First check the template settings if there is any alternative layout. If not, you have to duplicate the template and then tweak the copy to fit your taste.
To duplicate the template depending on your joomla version see this for J1.5 , this for J2.5 or this for J3.2.
After you do that, either hide via css the header element like so header{display:none;} or remove completely the <header>...</header> section from the index page of the template or from where this code is being generated.
Then assign this copy of the template to the pages you want.

joomla 3.1 ajax module

ok so I have a main horizontal menu that appears on all pages, (company, products, about us) and I want another menu, (vertical accordion on the left side of the page) inside products:
phone
--samsung galaxy s4
--iphone 4
pc
--hp pavilion
--toshiba
and when I clic on any of the sections of the accordion menu the information about each product appears on the right using ajax. I have made the accordion menu as a custom html module and the same with the content that its supposed to appear on the right side (I used modules instead of articles).
Now I'm thinking that its probably better to create another menu for the accordion and that the content should be articles, but I dont know how to make it look like an accordion, and I still need help using ajax to show the content of each product.
the main thing is, I want to use ajax to replace one module for another when I clic on any section of the accordion menu. is there any way to do it, all I could find in google its how to change the main article of the page, for that i have to replace
jdoc:include type="component" and add an event with the url but that replaces everything and I just want to change the right module/article
something like this
I dont know if I explained myself well.
I used shaper helix 2 template
Any help would be appreciated.
Check for some extensions here: http://extensions.joomla.org/extensions/structure-a-navigation/menu-systems/accordion-menus
An advice... you better forget ajax to load the catalog because as it used on the example the product pages are missed by search engines, as spiders and crawlers doesn't execute javascript. Try to search for that domain... results don't have any product.
Good luck!

How to have custom sidebar content per article in 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

Resources