How to Hide Or Remove URL Rewrite Management in Sub Menu in Magento - menu

Can anyone help me on how to remove or rather hide a sub menu in any of the menus in magento.
The image below may describe what I need in a clearer manner.
I want to, let's say hide the URL Rewrite Management.
How will I do it.
Thanks for the help.

//Working example code for remove catalog->url rewrite management sub menu.(As per below screenshot)
//Create a file called adminhtml.xml under /etc folder of your module:
<?xml version="1.0" encoding="utf-8"?>
<config>
<menu>
<catalog>
<children>
<urlrewrite> <!-- Same as <convert> -->
<depends>
<module>HideMe</module> <!-- Fake dependance to hide menu item -->
</depends>
</urlrewrite>
</children>
</catalog>
</menu>
</config>
More details

Related

In Hybris backoffice how do I add another tab in explorer tree for managing (create, search, delete) instances of some items?

In Hybris Back Office, how do I add another tab in the explorer tree for managing (create, search, delete) instances of some items?
I can't really find anything on the subject.
Do I need to use the already available UI for it or add my own widget?
In your *-backoffice-config.xml file, you have to add something like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://www.hybris.com/cockpit/config"
xmlns:y="http://www.hybris.com/cockpit/config/hybris"
xmlns:wz="http://www.hybris.com/cockpitng/config/wizard-config"
xmlns:list-view="http://www.hybris.com/cockpitng/component/listView"
xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea"
xmlns:explorer-tree="http://www.hybris.com/cockpitng/config/explorertree"
xmlns:simple-search="http://www.hybris.com/cockpitng/config/simplesearch"
xmlns:advanced-search="http://www.hybris.com/cockpitng/config/advancedsearch"
xmlns:df="http://www.hybris.com/cockpitng/component/dynamicForms"
xmlns:dsb="http://www.hybris.com/cockpitng/config/dashboard"
>
<context merge-by="module" parent="auto" component="explorer-tree">
<explorer-tree:explorer-tree xmlns:explorer-tree="http://www.hybris.com/cockpitng/config/explorertree">
<explorer-tree:navigation-node id="backoffice.myCustomItemType">
<explorer-tree:type-node code="MyCustomItemType" id="MyCustomItemType"/>
</explorer-tree:navigation-node>
</explorer-tree:explorer-tree>
</context>
<context type="MyCustomItemType" component="listview">
<list:list-view xmlns:list="http://www.hybris.com/cockpitng/component/listView">
<list:column qualifier="customAttribute1" />
<list:column qualifier="customAttribute2" />
</list:list-view>
</context>
</config>
Like way, you can configure "editorArea", "advanced-search", "create-wizard" etc by refering any OOTB backoffice-config.xml file.
Find this document for the steps.

Magento: How to add promo code form on one page checkout page?

I want to add a promo code form programmatically on one page checkout page of Magento 1.8 CE. This has to be added under payment review section.
Added following snippet to layout/checkout.xml of active theme:
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
then added following php code to template/checkout/onepage.phtml
But its not working, please help!
<?php echo $this->getChildHtml('coupon') ?>
In checkout.xml layout file add as following,
<block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">
...
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
...
</block>
And put the following code in app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/onepage/review/info.phtml
<?php echo $this->getChildHtml('coupon') ?>

How can I upload a KML file to a website for an organization with multiple locations?

I am trying to update a KML file for a website that has a multiple locations and having some trouble. I want to use it accordance with schema.org to get rich snippets in Google search results. My problem is I can't find a solid answer on how to relate multiple listings to the proper pages.
I think I understand how to create the KML file from these resources.
https://developers.google.com/kml/documentation/kml_tut
http://sixrevisions.com/web-development/5-little-known-web-files-that-can-enhance-your-website/
Here is my example code:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Hospital 1</name>
<description>Our first hospital</description>
<Style id="pin"><IconStyle><Icon><href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href></Icon></IconStyle></Style>
<Placemark>
<LookAt>
<longitude>-0.13642</longitude>
<latitude>50.819522</latitude>
<altitude>0</altitude>
<tilt>0</tilt>
<range>5500</range>
</LookAt>
<styleUrl>#pin</styleUrl>
<Point><coordinates>-0.13642,50.819522,0</coordinates></Point>
</Placemark>
</Document>
</kml>
I know that it has to be in the root folder and named after the site. But how do I name different locations or associate them to a certain page? Can I put the kml file on the different location pages?
I might be thinking about this in the wrong way so any help would be greatly appreciated.Thank you.
From your sixrevisions.com link, the part you are missing is that you have to reference this KML file on your webpage with a LINK tag:
<link rel="alternate" type="application/vnd.google-earth.kml+xml" href="SixRevisions.kml" />
The location and name of the file aren't important (as long as you update the href attribute). You can put this tag on whatever page you want so you can point each page at a separate file.

Sharepoint 2007 - custom context menu for certain file types

I was wondering if someone could help me out with Sharepoint 2007. What I want to do is to add a custom menu item to a context menu (the menu that opens when you click a document or another item).
Right now, the menu looks like this:
picture
I want to add an item, "Do stuff" for example, to this menu. Major problems:
I wish this item to appear only in menus for a certain file type (e.g. only for .html but not for .doc);
When I click this item ("Do stuff"), I want to call custom external code (written in C#, either an exe or a DLL), which accepts the name of the clicked file as an input parameter.
I understand the way to achieve this is by using Custom Actions (no javascript editing required in 2007, right?). But since I'm quite new to MOSS, I'm a bit lost and not sure what exactly to do and where to start, so any help is greatly appreciated.
You have to implement a CustomAction like this:
<CustomAction
Id="YourUniqueId"
Location="EditControlBlock"
RegistrationType="FileType"
RegistrationId="html"
Sequence="20"
Title="The text you want">
<UrlAction Url="~site/_layouts/company/ActionPage.aspx?List={ListId}&ID={ItemId}" />
</CustomAction>
What you put in the Url of UrlAction depends on what you want to do. It can be JavaScript or the url of a Page or Handler.
In my example it's a Page which gets the QueryParameters so that SPContext.Current.ListItem will contain the selected documents listitem.
<?xml version="1.0" encoding="utf-8"?>
<Elements Id="d0574a32-59ce-4561-9496-ccf17da37a35" xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="Test2"
Location="EditControlBlock"
RegistrationType="FileType"
//docx = documents, txt = text files, html = html files**
RegistrationId="docx" Sequence="10"
Title="View Item Properties">
<UrlAction Url="~site/_layouts/WSSHOL/ViewPageRedirect.aspx?listid={ListId}&itemid={ItemId}" />
</CustomAction>
</Elements>

ContentType DocumentTemplate not found in a List

I have the following Feature:
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="9A3C5D02-A2EB-4725-97F7-CDA6DE319F1B"
Title="My Custom Types"
Scope="Site"
DefaultResourceFile="core"
Hidden="TRUE"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="Elements.xml" />
<ElementFile Location="templates/MeetingMinutes.docx" />
</ElementManifests>
</Feature>
Which contains the following Elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Templates" Url="_cts/Meeting Minutes" Path="templates" RootWebOnly="TRUE">
<File Url="MeetingMinutes.docx" Type="Ghostable" />
</Module>
<ContentType
ID="0x01010066DD088A6B8B46BCA775CCD119FBB3E8"
Name="Meeting Minutes"
Group="Custom Content Types"
Version="0">
<FieldRefs />
<DocumentTemplate TargetName="MeetingMinutes.docx"/>
</ContentType>
</Elements>
I then use this ContentType within a custom List Template:
<ContentTypes>
<ContentTypeRef ID="0x0101">
<Folder TargetName="Forms/Document" />
</ContentTypeRef>
<ContentTypeRef ID="0x01010066DD088A6B8B46BCA775CCD119FBB3E8">
<Folder TargetName="Forms/Document" />
</ContentTypeRef>
<ContentTypeRef ID="0x0120" />
</ContentTypes>
I deploy the solution, activate the feature, and create an instance of the List Template. I go into the library and select Settings > Document Library Settings > Content Types: Meeting Minutes > Parent: Meeting Minutes > Advanced settings. I'm now in the Advance Settings of the Site Content Type. The URL of the existing document template is MeetingMinutes.docx and there is an (Edit Template) link which points to http://myserver/sites/testsite/_cts/Meeting%20Minutes/MeetingMinutes.docx. Everything's shiny.
But, I hit the back button two times so I'm back in the settings of the List Content Type. This time when I click Advance settings, the URL of the existing document template is still MeetingMinutes.docx, but there is no (Edit Template) link. Troubling.
Pressing on, I go back to AllItems.aspx and click New > Meeting Minutes. As Word is loading, I see a little Opening dialog which says, Opening: http://myserver/sites/testsite/Shared%20Documents/Forms/Document/MeetingMinutes.docx, to which Word responds: "Word was unable to read this document. It may be corrupt."
So the Document Template works correctly in the Site Content Type (where it does me no good), but is not working in the List Content Type (where I really need it). Now, I know I could put this in _layouts, but from what I've read, _cts is the way to do it. What am I doing wrong?
Rich, I'm not exactly sure what's going on because I created a feature using your feature and elements files as you specified and it works correctly for me.
There is one difference though.
When I create a new document in the library from the content type, the template url is
http://myserver/sites/testsite/Shared%20Documents/Forms/Meeting Minutes/MeetingMinutes.docx
Not
http://myserver/sites/testsite/Shared%20Documents/Forms/Document/MeetingMinutes.docx
Somehow your content type seems to be looking in the wrong folder for the template. I hope that gives you some clues.
I had the same exact problem with document template for List Content Type.
What I did is just what SharePoint do when you create your library from web site : duplicate the document template inside the “Forms” folder of the library in a subfolder that have the same name than the content type.
You just need to add a module element somewhere in your project :
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="MeetingMinutesListInstanceTemplate" Url="Shared Documents/Meeting Minutes" Path="templates" RootWebOnly="TRUE">
<File Url="MeetingMinutes.docx" Type="Ghostable" />
</Module>
</Elements>
It worked for me.

Resources