Overwrite Magento Adminhtml Store Switcher - magento-1.9

I'm trying to edit the Magento Admin Products Grid Page - Need to edit the Store Switcher Block that shows there, But I'm not able to.
Have created a class in my module in a blocks folder:
[Name]_[Module]_Block_Store_Switcher
and my config.xml file has:
<blocks>
<adminhtml>
<store>
<rewrite>
<switcher>[Name]_[Module]_Block_Store_Switcher</switcher>
</rewrite>
</store>
</adminhtml>
</blocks>
Not able to identify what I'm doing wrong here - any help is much appreciated!

Correct code would look like this:
<blocks>
<[Name]_[Module]>
<class>[Name]_[Module]_Block</class>
</[Name]_[Module]>
<adminhtml>
<rewrite>
<store_switcher>[Name]_[Module]_Block_Switcher</store_switcher>
</rewrite>
</adminhtml>
</blocks>

Related

Using Custom view.phtml into Magento using local.xml

I've been looking and I can't find the exact answer to my question. I've created a custom view.phtml file on my site and stored it in my "customchanges" folder located at /app/design/frontend/argento/default/template/customchanges/catalog/product/view.phtml
I've also created a local.xml file which I store in /app/design/frontend/argento/default/layout/local.xml
My code in my local.xml file is:
<?xml version="1.0"?>
<layout>
<default>
<reference name="product.info">
<action method="setTemplate"><template>customchanges/catalog/product/view.phtml</template></action>
</reference>
</default>
</layout>
But when I refresh the page (and use hints) I still get the default page. Please could someone help?
Thanks
Chris
I managed to fix this, if it's helpful here's the solution:
<layout version="0.1.0">
<catalog_product_view>
<reference name="product.info">
<action method="setTemplate">
<template>customchanges/catalog/product/view.phtml</template>
</action>
</reference>
</catalog_product_view>
</layout>

What's the difference between Properties/DisplayName element and VisualElements#DisplayName attribute in .appxmanifest file

In following appxmanifest, what is the difference between
Package/Properties/DisplayName element
and
Package/Applications/Application/VisualElements#DisplayName
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name=""
Version=""
Publisher="" />
<Properties>
<DisplayName></DisplayName> <!-- this -->
<PublisherDisplayName></PublisherDisplayName>
<Logo></Logo>
</Properties>
<Prerequisites>
<OSMinVersion></OSMinVersion>
<OSMaxVersionTested></OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="" />
</Resources>
<Applications>
<Application Id="" StartPage="">
<!-- and this -->
<VisualElements DisplayName=""
Description=""
Logo="" SmallLogo=""
ForegroundText="" BackgroundColor="">
<SplashScreen Image="" />
</VisualElements>
</Application>
</Applications>
</Package>
https://msdn.microsoft.com/en-us/library/windows/apps/br211475.aspx
Package/Properties/DisplayName
The DisplayName is the name of your app that you reserve in the store, for apps which are uploaded to the store.
This is the actual reserved name in the developer portal (= store). When you package your app for upload to the store, this will be automatically set when going through the wizard in Visual Studio.
The root element Visual Elements is how the Windows Store app is visualized on the user's pc/phone.
Package/Applications/Application/VisualElements
Describes the visual aspects of the Windows Store app: its default tile, logo images, text and background colors, initial screen orientation, splash screen, and lock screen tile appearance.
So the DisplayName property under the Visual Elements element is how the app's name is shown on the user's pc. This can be different from the name in the store (e.g. localized).
A friendly name for the app that can be displayed to users. This string is localizable; see Remarks for details.
There are two explicitly reserved words that may not be used as the DisplayName for apps uploaded to the Windows Store: "NoUIEntryPoints" and "NoUIEntryPoints-DesignMode". These identifiers are reserved for use by development tools and test suites.
Source: https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx
I have an app in the Store that may explain this issue.
Package/Properties/Display Name element refers to the app name in the Store which is the same as what's in Dashboard. While if you change the Display Name distribute in Visual Elements, your app will be different from itself in the Store after user installs it from the Store.

Make indexable an ajax based webpage

I want to make indexable my ajax based website.
I have read this doc: https://developers.google.com/webmasters/ajax-crawling/docs/getting-started But I don't understand it at all.
I think I need to do it:
Write this tag in a webpage, for example: www.myweb.com/mypage
<meta name="fragment" content="!">
I'm using UrlRewriteFilter for my Tomcat Server (http://tuckey.org/urlrewrite/), so I think I could redirect the urls with the substring: "?_escaped_fragment_=" to a html snapshot (which I can build manually, writing my custom meta-description, title and content???)
<rule>
<from>^/mypage\?_escaped_fragment_=</from>
<to type="forward">/snapshots/mypage.html</to>
</rule>
Write the URLs (without the escaped fragment) into the sitemap.xml
...
<url>
<loc>www.myweb.com/mypage</loc>
...
</url>
...
Is it right? I need to do something more?
Ok, it is right, but the UrlRewriteFilter syntax is a bit different:
<rule>
<condition name="_escaped_fragment_" type="parameter" operator="equal"></condition>
<from>^/mypage/</from>
<to last="true">/snapshots/mypage.html</to>
</rule>

Razor RenderPage my.js without HttpException

Suppose I want to render javascript from an external file inline into my layout file for performance reasons.
If I use the following Razor code
<script>
#RenderPage("~/Content/my.js")
</script>
results in
Server Error in '/' Application.
The following file could not be
rendered because its extension ".js" might not be supported:
"~/Content/my.js".
If I merely rename my javascript file to my.js.cshtml
<script>
#RenderPage("~/Content/my.js.cshtml")
</script>
The peasants rejoice.
The question:
Is there any simple way for me to prevent RenderPage from nagging such that I can tell it that the .js extension is fine?
With some feedback from #choudeshell one potential solution is:
<compilation debug="true" targetFramework="4.5">
<buildProviders>
<remove extension=".js"/>
<add extension=".js" type="System.Web.WebPages.Razor.RazorBuildProvider,
System.Web.WebPages.Razor"/>
</buildProviders>
</compilation>
What type of side effects would there be from removing whatever the default is for .js, any?

How to display a detailed map and highlevel map in different classes/tabs?

I have two activities, ListViewActivity and MapViewActivity which both run within a TabHost; everything is working fine and I am able to view my list, add POIs to the map, change between tabs etc.
What I have also done is to 'extend' my ListViewActivity so that when an item in the List is clicked, the view is switched (via ViewSwitcher) to show more detail (note: this happens within the same tab); again this all works okay and I am able to flip between the list view and the detailed view which contains text elements, buttons etc.
But, since I've only been programming in Android/JAVA for a few weeks, I've hit a brick wall... and need some pointers/high level examples to get me going again.
<com.google.android.maps.MapView
android:id="#+id/mapView"
android:layout_width="150dp"
android:layout_height="150dp"
android:apiKey="0sQLOXF5j7iM03sd-IyVldoGjh0voa5-qqFRRlw"
android:clickable="false"
android:enabled="true" />
Specifically, I want the 'extended/detailed' view within the ListViewActivity to include a detailed/zoomed map. However, when I try to include the map definition in my XML code (see above), it causes the application to crash - I am assuming because there is already a map defined in MapViewActivity (i.e. this code appears in both my ListViewActivity.xml and my MapViewActivity.xml files)?
I've read found other pages such as this, which recommend using the android:process attribute in the manifest to assign acitivites, for example:
activity android:name=".activity.directory.MapView1" android:process=":MapView1"
activity android:name=".activity.directory.MapView2" android:process=":MapView2"
However, I am uncertain how to implement this - i.e. how do I call the process from either the ListViewActivity or MapViewActivity class such that either a detailed or high-level map is displayed?
Currrently my AndroidManifest.XML file is as shown below; I know this is incorrect, but like I said, I'm stuck in figuring out how to have a map both in my ListViewActivity and in my MapViewActivity:
<application
android:icon="#drawable/launcher"
android:label="#string/app_name" >
<activity
android:label="#string/app_name"
android:name=".DummyAppName" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ListViewActivity"/>
<activity android:name=".MapViewActivity"/>
<activity android:name=".FavouritesActivity"/>
<activity android:name=".SettingsActivity"/>
<activity android:name=".activity.directory.MapView1" android:process=":MapView1"/>
<activity android:name=".activity.directory.MapView2" android:process=":MapView2"/>
Sorry for the long post. I hope it makes sense and I hope someone is able to offer some ideas/suggestions on how to fix my problem (is it even possible?).
Thank you!