Breadcrumb in magento - magento

I am to magento. I got breadcrumb in my static blocks by default. But In my dashboard page, it is not displaying.I have searched in Google but nothing works. Can anyone tell me how to add breadcrumb in my dashboard page.I want to display breadcrumb without using page.xml
Thanks in Advance.

Go to app\design\frontend\your-package\ your -theme\template\your-modulename\phtml-file and add the following code snippet as per your requirement
// to get breadcrumbs block
<?php $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
// add first item ‘'home'’ with link
$breadcrumbs->addCrumb(
'home',
array(
'label'=>$this->__('Home'),
'title'=>$this->__('Home'),
'link'=>Mage::getBaseUrl()
)
);
// add second item ‘'brands'’ without link
$breadcrumbs->addCrumb(
'brands',
array(
'label'=>$this->__('Brands'),
'title'=>$this->__('Brands')
)
);
echo $breadcrumbs->toHtml(); ?>

By default in magento breadcrumb not come for member account section. You can add breadcrumb using xml. Here is the blog post that explain complete steps:
http://www.douglasradburn.co.uk/adding-breadcrumbs-to-customer-account-pages-in-magento/
You can also use the below extension to add breadcrumb links:
http://www.magentocommerce.com/magento-connect/customer-account-breadcrumbs.html
You need to check its compatibility with latest version.

Related

Prestashop 1.7 Breadcrumb titles

I am trying to edit the breadcrumbs in a custom Prestashop theme that I am making based on the Classic theme in version 1.7.6.8. The website I am working on has Prestashop located in a folder at mydomain.com/shop, so I would like the breadcrumbs to read:
Home / Shop / Products
Where Home links to mydomain.com and Shop goes to mydomain.com/shop.
I have added the link for Home to mydomain.com ok. Now I want to change the default Prestashop breadcrumbs because it currently reads:
Home / Home / Products
The second home goes to the right link (mydomain.com/shop) but I don't know how to change it to read Shop instead of Home. I have found a way to edit the controllers so as to remove the second home link, this would allow me to just add a new link with Shop next to the new Home link that I already added, however this doesn't seem like a very elegant solution and will require altering the script on lots of pages. Surely there must be a better way?
Thanks for any feedback.
Edit: Here is the code from controllers/productController.php
public function getBreadcrumbLinks()
{
/*$breadcrumb = parent::getBreadcrumbLinks();*/
$categoryDefault = new Category($this->product->id_category_default, $this->context->language->id);
foreach ($categoryDefault->getAllParents() as $category) {
if ($category->id_parent != 0 && !$category->is_root_category) {
$breadcrumb['links'][] = $this->getCategoryPath($category);
}
}
if (!$categoryDefault->is_root_category) {
$breadcrumb['links'][] = $this->getCategoryPath($categoryDefault);
}
/*$breadcrumb['links'][] = array(
'title' => $this->product->name,
'url' => $this->context->link->getProductLink($this->product, null, null, null, null, null, (int) $this->getIdProductAttributeByRequest()),
);*/
return $breadcrumb;
}
You can see the two sections I have removed, the first removes the default "Home" link, the second removes the link with the product name that I do not need. Obviously the code goes somewhere to look up the link and matches it to a name, I just don't know where.
I found the answer, you can change the tag from "Home" to "Shop" by altering the files in shoproot/var/cache/prod/translations/catalogue.[your language].php
There are a number of places where "Home" appears in the file, to change the breadcrumb it is around line 6370 in the en-gb version.
EDIT: Here is a better option, from your Prestashop control panel you can go to international, translations, modify translations. From the drop downs select theme translation, the theme you are working on, the language, click modify, search for "home" and then put the translation as "shop". This saves you having to make the change to the cached file if you have to clear the cache from the control panel.

Edit JomSocial Joomla Registration Page & Adding Content

I'm running JomSocial 3.2 on Joomla 3.
I want to add some content to the right side of the registration page.
Some pictures and other contents.
So far, i've been able to get to the "register.index.php" file,
which is the file that displays some of the content in the homepag.
The file is in: "/site_root/components/com_community/templates/default/" folder
but i've not been able to fully edit the whole registration page.
This could be done in many different ways - even without editing any file. Install this extension: http://extensions.joomla.org/extension/advanced-module-manager and when editing module you'll have additional tab called "tasks" There will be field URL, type inside URLs of your registration form. Thanks to this you'll be able to assign modules to registration form.
You could also override for:
ROOT/components/com_community/templates/default/register.index.php
Copy it to:
ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)
Then you may create module position inside file using this code:
$modules = JModuleHelper::getModules( 'reg-positon' );
foreach ($modules as $module) {
$_options = array( 'style' => 'xhtml' );
echo JModuleHelper::renderModule( $module, $_options );
}
Above code creates module position: "reg-positon'. You'll need to type this name manually as it will be not listed on module positions list.
Now you'll need a bit of html to display it on right or left of registration form.

Joomla display view not displaying site template

I am trying to load a view from my controller using the follow code but I only get a raw HTML view and does not show the site's template.
$view = $this->getView( 'download', 'html' );
$view->display();
Can some help me in what I am doing wrong to display the site's template.
I also tried a redirect but that did not work either
$this->redirect(JRoute::_('index.php?option=com_atdwcsv&view=download'), false);
Edit: I figured out what was wrong with the redirect. Code I needed was
$this->setRedirect('index.php?option=com_atdwcsv&view=download');
$this->redirect();
I could be wrong, but I don't think you need to use the display() method on the view, I think you need to use $this->display(); instead.

Displaying a static block as a popup window in Magento

I'm trying to display a static block in Magento as a popup window, but can't seem to get the code to work.
I've found code in various places on the internet that seems to be fairly close to what I want but I can't get any results. I've used the basic code to return the "top links" to my site so I know that the basics work.
I've created a delpopup.php script in my Magento root folder and put in this code:
<?php
require_once('app/Mage.php');
umask(0);
$layout = Mage::app()
->getLayout();
$layout
->getUpdate()
->addHandle('default')
->load();
$layout
->generateXml()
->generateBlocks();
echo '<p>before</p>';
echo $layout
->createBlock('cms/block')
->setBlockId('delivery-info')
->toHtml();
echo '<p>after</p>';
?>
Unfortunately the code doesn't display the static block. That part of the output is blank.
The idea is that I can place a link in a regular page in Magento and have my delivery into pop up. Like this:
<a title="" onclick="popWin('http://www.mysite.com.au/delpopup.php', 'deliveryinfo', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" href="#">Delivery Info</a>
Basically I want to be able to display a static block in a popup window that uses my Magento site's theme. Any ideas would be greatly appreciated.
As I thought, the problems lies on incorrect Block Id.
Now that the cms is able to be shown.
So now the question is: how to get the theme work?
Not really sure what do you mean by theme, if what you mean is css that was included in <default> tag, you can use:
Mage::getDesign()->setTheme('your theme');
echo $layout->getBlock('head')->toHtml();
After the xml has been finished generated, it means put that code after:
$layout
->generateXml()
->generateBlocks();
I'd first setup a controller and block(s) to render the type of layout that you want to throw within the popup. So, instead of doing this within a standalone php file, do it within the regular mage framework within a specific controller action.
Then, once you have that working - the question is how to pull it into a popup. I'd go with maybe a nice jquery popup widget that allows you to specify a URL to hit - and then just pass in the one that you prepped for step 1 above.
You may want to look at adminhtml/default/default/template/popup.phtml for inspiration. That's actually a popup template for the admin, not the frontend, but you can see what they've done.
They're pulling in some standard magento blocks including the head block, which should pull in all your CSS and JS, in order to give you the general color scheme / look&feel of your frontend, but without all of the navigation, etc.

Unsubscribe link is not working in magento newsletter template

I have created one newsletter template in my store ( magento based ) and have added following code to make unsubscribe link:
Follow this link to unsubscribe:
{{var subscriber.getUnsubscriptionLink()}}
But, when I tested it there was no link received in my email. I can see only "Follow this link to unsubscribe:" in my email but there is no link to unsubscribe this email.
Note: I have added this content under "Template Content" section.
Please help!
Thank you in advance!
In your Template.php file the getTemplateText function should look something similar to this;
public function getTemplateText()
{
if (!$this->getData('template_text') && !$this->getId()) {
$this->setData('template_text',
Mage::helper('newsletter')->
__('Follow this link to unsubscribe <!-- This tag is for unsubscribe link -->
<a href="{{var subscriber.getUnsubscriptionLink()}}">
{{var subscriber.getUnsubscriptionLink()}}</a>')
);
}
return $this->getData('template_text');
}
Is this what you are using? It could be that the tags have been removed.
You should also check what happens when the emails are sent to different mail clients, just to rule out local factors.
I know I am late here but still I want to share solution here.
I am using Magento 1.9.
To add newsletter unsubscribe link in newsletter template here are following steps:
Override the core file
/app/code/core/Mage/Newsletter/Model/Subscriber.php
by copy in local directory
/app/code/local/Mage/Newsletter/Model/Subscriber.php
Open in editor to edit the code and seacrh the function sendConfirmationSuccessEmail()
replace the code
$email->sendTransactional(
Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
$this->getEmail(),
$this->getName(),
array('subscriber'=>$this)
);
with this
$email->sendTransactional(
Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
$this->getEmail(),
$this->getName(),
array('subscriber'=>$this, 'unsubscribe' =>$this->getUnsubscriptionLink())
);
and place this code in email template where you want to use unsubscribe link:
Unsubscribe here
That's it!
Hope this helps someone.

Resources