Disable a Module in Certain Theme - magento

Is it possible to disable certain modules when running a certain theme? I'm working on a mobile friendly version of our Magento store and I've run into some issues with a few extensions. Rather than customize them, the default iphone theme is sufficient, so I'd like to just disable those modules so it runs the default code when on a mobile device. Is this possible? If not, perhaps I'm approaching this from the wrong angle. What is the right way to handle this type of thing?

It sounds like you need to look into the Exceptions portion of the System configuration, you should be able to at least setup some conditions for mobile user agents.
An Article I wrote a while back on using the iphone theme for android may help shed some light for you:
http://www.molotovbliss.com/iphone-magento-theme-compatible-with-android
As far as disabling modules based of the exceptions sounds like you'll need to manage the modules etc/ xml files to set <active>true</active> to <active>false</active> when needed, however I believe you could disable the output of the module via a built in method also.
Hope this helps.

Brian, I think you can do it using local.xml file that is template dependent.
Here are some examples from my file:
<default>
<reference name="left">
<remove name="left.newsletter" />
</reference>
</default>
When you use the remove tag, it removes any blocks with the specified name from
the entire layout, regardless of the context. So, if I remove right.newsletter in
the context and that name is used in say the context,
then both blocks will be removed. Because remove operates on the global context,
you can only remove an element once.

Related

Can I remove block and revert it by layouts in magento2.1.4

I am using magento 2.1.4. I have two themes one for desktop and another for mobile. I want to remove two blocks in desktop version only.
I have used
<referenceBlock name="block_name" remove="true"/>
to remove the block from the desktop layout
And used the below code to revert deletion in mobile theme
<referenceBlock name="block_name" remove="false"/>
But this isn't work properly is there is better solution with out any code change to do so??
There is no need to add <referenceBlock name="block_name" remove="false"/>
Remove this code from you mobile theme xml file. When you apply the moble theme, envirment will read current theme and then appy thw changes.
And if changes in not visible on frontend , then you need to deply again.
I came across the same situation, here is what I did fixed the issue.
In our main composer base template wishlist was removed,
<referenceBlock name="view.addto.wishlist" remove="true" />
Instead of setting remove="false" or display="true" (Which I have tried but not worked for me), I have added the below code in
app/code/design/frontend/custom_template/default/Magento_Catalog/layout/catalog_product_view.xml
<referenceContainer name="product.info.form.content">
<block class="Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist" name="view.addto.wishlist.added" template="Magento_Wishlist::catalog/product/view/addto/wishlist.phtml" after="-"/>
</referenceContainer>
The Trick here is, adding a same block with different name "view.addto.wishlist.added"
Hope it helps someone.
Thanks
Kishore

How to disable extension for a particular extension in magento?

I am overiding the deafult onepage_payment_methods in my custom extension.
I want to disable the extension fully (not only output) for particular store. Please guide as I am new to Magento.
Magento modules are enabled/disabled by a line in their .xml module control file found in app/etc/modules
To completely disable the module, find the .xml file named for the module (example DeveloperName_ModuleName.xml) and change the following line:
<active>true</active>
to
<active>false</active>
Watch for dependencies and if you are looking for specific Magento modules, most will be found in Mage_All.xml, other standalone modules will be found in Mage_xxxxxxxx.xml. Be aware that turning off certain Mage modules will have knock-on effects and disabling Mage_Core turns Magento off.
StackExchange question on disabling a module on the store level
Please go to your admin section than login to your backend, system- configuration->advance -> advance search your extension name and disable it.
Hope it works

How to customize Xamarin.Forms app?

How can I customize the appearence of xamarin.forms components?
I want each button to have the same image, for instance. Or for all systems to share the same login screen with the same background image.
I know I can do that by adding one specific screen to each platform project. But I want to be able to customize the component itself. Example: All buttons will have the same background image no matter which platform is running.
I've read these:
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/styles/
http://code.tutsplus.com/tutorials/getting-started-with-xamarinforms-customizing-user-interface--cms-22144
The most promising one seems to be the last one. Is a custom renderer the only way to accomplish this? Can't I just add an image at the shared project and it automagicaly works for all platforms?
Thanks.
It's not absolutely clear, what exactly you want to reach... but I try to answer you.
If you use a shared project (based on template "Blank App (Xamarin.Forms shared)", you can use the same page / page-definition in all of your platforms.
You can add - e.g. a login-form in the shared-folder and then call it from code (e.g. from another page in the shared folder).
If you want to create your own controls, you can create "user-controls" and use it everywhere you want (what I recommend to every user).
You do this, by create a own class (e.g. with an Entry and a Label), implement the events and then instantiate it where you want to use it. E.G.
var OeFirma = new EntryErfassung(cDefaultText: "Firma", iMaximalLaenge: 45);
where OeFirma is the name of the object-instance on the page (to access it), EntryErfassung is my own class (that contains a description-label, an Entry an error-label and more) and cDefaultText is a parameter, that overtakes and set the default-text to the Entry and iMaximalaenge is a further parameter that is overtaken whereby my class then take care, that not more then 45 Characters are accepted for this Entry).
I have e.g. created a class with a description-label, a delete-button, an Entry and a error-label ad use it on all data-entry-forms.
If you want to change the look-and-feel of a specific control for a specific platform, you can create a "custom-render" (I have done this e.g. to change the font-size to the edit specific for iOS, as the font-sinze cannot be set in the XF-Entry control).
Hope this answers your question...
To do this, you can just specific a style in the App class, (you will need to change the app class to be made up of 2 partials: App.xaml & App.xaml.cs, and then create a ResourceDictionary to hold your customisations.
<Style TargetType="Button">
<Setter Property="Image" Value="MyImage.png"/>
</Style>
Hope that helps.
Cheers,
Tristan

How to remove tab from child theme added in custom default theme?

I know, confusing title..
So basically I have an custom theme. The files I'm gonna talk about it located like below :
frontend/custom/default/layout/local.xml
frontend/custom/blue/layout/generallayout.xml
In local.xml, I have added a tab like this
<action method="addTab" translate="title" module="tag"><alias>product.tags</alias><title>Product Tags</title><block>tag/product_list</block><template>tag/list.phtml</template></action>
Now I wanna remove this tab in blue/generallayout.xml. So I added :
<catalog_product_view>
<reference name="product.info.tabs">
<action method="unsetChild"><name>product.tags</name></action>
</reference>
</catalog_product_view>
The problem is, this is not working cause I think layout.xml renders after generallayout.xml. So there isnt anything to remove while in generallayout.xml. How I achieve removing the tab ?
I'm sure there isnt anything wrong with what I wrote cause I copied the second snipped to local.xml and I successfully added then removed the tab.
For reference, I couldn't resolve this with this method.
I looked at the magento's core php files and saw that 'local.xml' always renders last. No way to change it without overwriting the core files.

Magento 1.7 Theme issue

Trying to change a theme in magento 1.7. Editing the page.xml file but the effects are not being seen. Changes the tags in page.xml but none of the changes appear on site.
What am i doing wrong?
All layout files will be cached (unless you have this disabled) - try and clear your layout cache first. Do this by logging into the admin area and go to system > cache management and refreshing the Layout cache type (second option down on a standard install).
If you are still in development, it may be an idea to turn caching off.
If the updates that you have made still do not take effect, then double check you are editing the correct file by making sure you are working in the correct package and theme.
Just as an aside, also look into using the local.xml file for all of your core layout overrides instead of copying over the core file into your theme and editing. It makes for a better/faster workflow and and cleaner less error prone upgrade path (though there are scenarios where it isn't the best option)
Clear your cache (the page layout updates XML tree is a cache item)
Make sure you are editing the correct page.xml file (try making the changes in local.xml in the same layout directory to make sure that you are in the correct theme)

Resources