How can I add a custom sidebar in the magento backend? - php

I have created a custom module for the backend. Now I need to configure an admin template for my custom module.
I am able to create a new template for the frontend in magento. But I still don't understand, how to create a new theme for the admin side.
And also, I have designed my own header, footer and sidebars (left and right) for my new admin theme.
Can anyone help me with this?

See the following link from Inchoo. They have an excellent module solution for creating a custom admin theme, without chopping up the default one. Its ridiculously simple as well. Its also upgrade proof. I used it to add a few more attribute selections to the product list.
http://inchoo.net/ecommerce/magento/custom-admin-theme-in-magento/
You then just create your theme in /var/www/app/design/adminhtml/default/NAMEOFYOURTHEME
You can also just make css tweaks by adding /var/www/skin/adminhtml/default/NAMEOFYOURTHEME/custom.css (which is located in the default theme, so override it)

Related

Create custom theme from scratch in wordpress without using default

I am developing a custom theme from scratch in WordPress, So i have few questions about it.
1) Is custom theme create using default theme.
For example ( Suppose i have copied twentyseventeen and paste it and rename it my_custom_theme then after changes as per HTML in particular files (header,footer etc)
2) Should i create necessary files for theme like (header, footer, index, style, page, function etc)
So i want to clarify which way should i go for create a custom theme 1st or 2nd.
Someone please help me for this
I would recommend using underscores
It is a starter theme foundation setup built for that purpose, it has all the needed files templates and uses the best practices and organised code.
You will take it and build your theme from it.
There is also understrap which is underscores with bootstrap styling
this will save you alot of setup and preparation time, you can delete and remove any code or any template you not using.

Overwrite WordPress plugins in child theme

The WordPress plugin WooCommerce allows me to overwrite any of its files by making a copy of that file and placing it in my child theme directory. This does not work for other plugins.
How does this functionality work for WooCommerce?
Why doesn't it work for other plugins?
How can I make it work for other plugins?
Not all plugins need this functionality so it is not standard, it's just something you can allow your plugins users to do if it is relevant to its functionality / theming.
There is a great article here on how to achieve it for your own plugins, however you cannot apply this to existing plugins unless you want your copy of an existing authors work to fall out of date.
http://jeroensormani.com/how-to-add-template-files-in-your-plugin/
How does this functionality work for WooCommerce?
The magic is in the coding of Woocommerce. They have added functionalities in to cater for this because of the technicality of their system and the demand for customization.
Why doesn't it work for other plugins?
Woocommerce have added this functionality within their development to cater for this functionality, simply said other plugins have not added this functionality to extend or customize their add-ons.
How can I make it work for other plugins?
The answer to this is hooks. The same way plugins "HOOK" onto wordpress, you can create a hook to do the same for the plugin. Have a search at "custom hooks"
This is because WooCommerce has implemented this functionality in their plugin.
Overwriting plugins is not a Wordpress core functionnality.
You can't overwrite a custom plugin, the only way is to duplicate his content creating a new plugin, and customize this new plugin made by yourself..

Add back-end WP plugin to front-end template

I just need to be pointed the right direction here, I don't expect the exact answer.
Basically, I got a wordpress plugin for woocommerce. It adds a new metabox with options to choose from within the 'add new product' area in admin back-end.
Plugin here https://wordpress.org/plugins/woocommerce-incremental-product-quantities/
My theme with other plugins allow me to add new products from the front-end and so I would like to use this plugin also from the front-end.
So how can I bring the plugin to my theme template to be able to choose its option from the front-end? Or what steps to take that I could google some tutorials and take it from there?
I haven't tried anything just yet, I just have no idea where to start.
Any help is appreciated

Theming Drupal 7's Ubercart "/cart" page

I'm trying to theme Drupal 7's Ubercart 3 /cart page, but I'm struggling to find the theming function to do so.
I believe the right code may be located in template.tpl.php, but I am not sure.
Where in Drupal is the code to theme this page?
Create a new template file and name it page--cart.tpl.php
For more information about Drupal theming suggestions: http://drupal.org/node/1089656
(Don't forget to clear the cache after adding the new template file)
Another way to use Devel module with theme developer module to get all available theme suggestions.
Update:
If you are looking to style just the cart section, why don't use CSS. In Ubercart, the cart section has an div id div#cart-form-pane

Retrieving names of over-ridden theme hooks in views 2 (Drupal 6)

I have a created a view (lets call it my_view).
In the theme: information section if the view I have noted one of the suggested template names (views-view--my-view--default.tpl.php (or close to that)), and created my own template file with that name.
This all works fine and when I visit the theme registry, I can see there is a hook there with the name of the template (views-view--my-view--default). However this hook has a type field of 'engine' rather than 'module'. I assume this is to do view the way views works out its own theming?
I want to implement hook_registry_alter to modify this theme hook (and others created in the same way), but I cant work out how to retrieve a list of these hooks.
I tried using array_keys(views_theme()) to get all the views hooks back but this list doesn't contain hooks created by over-riding template files. It only contains the default hooks like views_views_field etc
Is there a way to bring back a list of views theme hooks over-ridden in this way?
I answer here as your last comment seems to indicate you are not interested anymore in pursuing your initial approach, and 600 chars would not be enough, anyhow.
An alternative approach to achieve what you want could be to use the "inheritance" of sub-themes from their parent theme. You could in other words define your user theme as a sub-theme of the admin theme.
In this way the theming engine would search for templates - in the case of a user viewing the site through the user theme - first in the user theme folder, then in the admin theme folder, and then in the module directory.
This is for example the same mechanism used by zen for letting you create your themes with the starter kit.
Hope this helps!

Categories