Magento - Hardcoded top nav menu item linking to external site - magento

I've searched hi and low for an answer to this seemingly simple question, however I have not found a working solution.
My top nav menu in Magento is hard-coded to include CMS pages (no problems there as the CMS pages are built off of the BaseURL) However one of my links needs to go to an external site but everything I've coded so far is adding the baseURL and therefore is going to 404 Page.
Here is an example of the most recent code I've used - I removed the Mage::BaseURL from the code. Still no luck. I did see a crazy work-around through categories but would prefer to not go that route as I have less control of where link will be located in the top nav menu (my categories load first, but this link needs to be the last in nav)
class="level0 level-top first"><a class="level-top" href="<?php echo $this->getUrl('http://www.externallink.com/')?>"><span><?php echo $this->__("Restaurant") ?></span></a>
Anyone have a suggestion? I'm stuck. Thanks!

You don't need to use PHP code to echo out the link. Just put it in the HTML. When you call 'getUrl()' it will prepend the base_url

Related

Magento, how to change home page?

I see that you can set a cms home page at "Default Pages" at admin panel (system/configuration/web) but I want a whole template including [html][head][body] tags to be shown, is this possible?
I can't do it via (CMS/Pages) as it deletes/modifies the code.. Even when I set it on "empty" don't really understand it..
Help would be much appreciated, cheers!
The file that you want is the layout file. If you need to add new layout of your home page then you can make a new layout file using following link
http://rakeshwebdev.wordpress.com/2014/02/13/add-new-custom-page-layout-in-magento-1-7/
Then after making layout while creating CMS Page go to layout section and choose your created layout. Then your home page will have what you want.
Note: By default header, footer all these are kept in different file and called from the 1column.phtml etc. So it will be always better to keep it that way only. As we always should follow Magento programming methodology.

Home Store View and Editing Home Link in Magento

I'm not a web designer/coder but a friend had a designer quit on him and is needing some help getting his website up and running.
Website is www.wilfrednewman.com
They are using magento 1.7, blanco theme.
I'm wondering a couple things:
1) How to edit the first item of the menu (Clothing that leads to coming-soon.html). In the CMS Static Blocks he has page-menu defined which is where the other links are generated(bespoke,wedding,about,press,store), but Clothing is not there. I just don't know where to edit Clothing.
I can go through the tutorial and see how to make nav_block1 for blanco ( http://www.techturn.com/TT/Blanco_Magento_Theme.pdf ), and I have successfully done that. It just adds a link to the end of the menu he already established. I think I could likely follow that to add all my links, but I just don't know how to edit the first link so it doesn't matter
2) How do I get a "storefront" view. Just some basic store-front that has the newest products listed? That's what I would want Clothing to link to.
Googling these problems generally brings me the wrong solutions, such as editing the Home button in the Magento Navigation, so I can't find the solution for what I need, so I'm sorry if this is common but I'm just not googling the right thing!
To Edit Clothing link,
app/design/frontend/default/blanco/template/catalog/navigation/top.phtml. I think he had added page-menu here. Kindly check.
If you want to display products in clothing link, Add the below line in CMS Page (coming-soon).
Please change the category_id as you want.
{{block type="catalog/product_list" category_id="xx" template="catalog/product/list.phtml"}}

No horizontal navigation showing on Magento custom theme

I have decided to sit down and build my first custom theme in Magento and I'm using this tutorial: http://net.tutsplus.com/tutorials/php/magento-for-designers-part-4/
However I cant for the life of me find a way to include horizontal navigation (Home | Shop | Contact etc.) along the top of my website!
I tried all the suggestions I could find including placing everything in the root category and enabling all cats in the navigation.. refreshing the cache etc.
I've been working at this for hours now and been searching everywhere for an answer. I've pretty much followed the tutorial step by step but I can't see any way to enable the Nav - can someone please point me in the right direction with this?
(I'm kind of assuming Magento have a way to do this to add categories automatically - I'm aware I could hard code the navigation bar but I'm trying to avoid this.)
Looking at the screenshot on the tutorial, it doesn't actually have the menu anyway.
I'd recommend you check out leveluptuts magento theming tutorials, who actually take the base theme and manipulates it into the desired theme. I think you'll have much more luck that way as most of the templates and layout files are already built.
http://leveluptuts.com/tutorials/magento-community-tutorials/25-theming-magento-1-intro-theming
For the top menu, the default theme pages call the "header.phtml" template for the header block (app/design/frontend/base/default/template/page/html/header.phtml), which in turns calls the "topmenu.phtml" template (app/design/frontend/base/default/template/page/html/topmenu.phtml) where the menu code is.
The layout files is page.xml
Hope this helps!

joomla 2.5 - removing frontpage content block for joomlaxtc website

I have tried to look around all over the place to edit the joomla frontpage. Im using a template from joomlaxtc which is another reason why I believe im having trouble as the coding is a little different.
What I'm trying to achieve is remove the component or article area for my Joomla 2.5 front page.
here is the website
http://colmandesigns.123abc.co.nz/tyrelink/
as you can see the 'coming soon' white text box I want to remove however I only want to remove it for the front page not the rest of the pages.
I can't get your site to come up, but the home page of a joomla site is generally determined by the default item on your main menu.
From the admin Control Panel:
Choose Menu->Main Menu
Locate the menu item on the list that has a star in the "Home" column
Click on the menu item, and from what you see, determine what the article is
Go to that article, and edit there.
This presumes that your home page is an article, as is the case in a standard Joomla site, and doesn't account for anything your template may do in terms of features or settings,
Simply go to the template manager and go to the advanced parameters and see the show component on home page and select NONE
If you want to remove the "coming soon" bit, then go to the module that holds the "coming soon" bit. On the left, you should see "Module assignment." Click that, and choose "no" for Home Page: assign to.
This video may also be helpful.
Your template may have configuration to hide main content block from frontpage but if not then it can be hidden by using code block below on index.php or your php file which will define template layout.
<?php if (JRequest::getVar('view') != 'featured'): ?>
<div id="maincontentdiv"><jdoc:include type="component" /></div>
<?php endif; ?>

Keep Firefox sidebar links in the sidebar

I've created a bookmark in Firefox that links to a hosted web application I've written and displays the application in the sidebar using the "Load this bookmark in the sidebar" option.
When the application appears in the sidebar and I click links there, those links open in the current Firefox tab rather than staying in the sidebar. I would like the linked page to appear in the sidebar.
I'm hoping there's a simple solution, like setting the default target via a base tag, but I can't find a reference that gives me the information I need. It would be useful if the solution does not limit the application to the sidebar exclusively, and still lets the application run full-window.
I think all you need to do is link, or add target="_self"
This may be more a potential workaround than a real answer, but you could try using javascript to change document.location to the new URL. Something like:
<a href="javascript:document.location='http://whatever'>click me</a>
This would use the same 'window' object to display the new page and should load in the sidebar.

Resources