Best way to link Category to customized Modul - magento

So far i have found two ways of liking a category to a customized module. By Category i mean created in Admin->Catalog->Manage Categories->created new category. By Customized module i mean module created in code(app/code/local)
way to link
Till today I used Admin->Catalog->Url Rewrite Manager to direct some category(blog) to some customized module(blog/index/index). So, in Url Rewrite manager I created rewrite entry that had Request-Path hold Category Url-key(blog-index.phtml) and Target-Path hold my costumized module path (blog/index/index). It stop redirecting today by having automatically putting different target path (catalog/category/view/s/blog-index/id/)...i am not sure why
2.way to link
In category layout xml file I put handle
This does the work but it requires to mess with category module that i prefer not to do. It also has link(catalog/category/view/s/blog-index/id/) that does not favor search engines
Is there better way to link category to my costumized module?

The layout XML can go in your module's layout XML file (layout/blog.xml for example) if you'd prefer, the file that layout XML resides in has little importance (you'll need a <layout> section in your config.xml if you don't already have one)

Related

Create admin front with a simple form via a module [Magento]

I am pretty new to Magento and am trying to understand how to create admin (backend) page. I have figured how to create/define the controller and action (along with editing the config.xml).
But now the next problem at hand is to display a simple form in that page. I understand that, I have an option to create blocks and mention the blocks in a layout.xml. But from what I figure is that layout.xml needs to be present in the theme folder. Which I can't do as my magento extension will be installed and I have no access to the user's system.
So the doubt is. How to display a simple from in a backend (admin) page
without having to make any changes to the theme's layout ?
For the admin panel module you don't need to mention the block in the layout.xml of your theme, you only need it to be defined in config.xml file in your "app/code/local///etc/" and a layout file is created in "app/design/adminhtml/default/default/".inside the Block create a folder named "Adminhtml" inside it your can create your form.
Refer this
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/how_to_create_an_admin_form_module

Different .phtml to diffrent type of product

I am trying to make module that switches diffrent .phtml of productview depend on attributeset name. I dont know witch file is responsible for rendering productview.
It is usually Magento Block that render template. In your case productivew is rendered by
Mage_Catalog_Block_Product_View.
You can easily figure this out by enabling template_hints and template_hints_blocks. To enable these to option follow steps below:
Go go Admin
System > Configuration
In left column, Select Developer under Advance.
Change Current Configuration Scope to website level (template_hints and template_hints_blocks is applicable at website level only)
Make yes to Template Path Hints and Add Block Names to Hints under Debug group.
you can rewrite this class:
Mage_Catalog_Block_Product_View
and then you can add your own logic to it to switch to another template, not the standard
catalog/product/view.phtml

File location of phtml file of backend admin page

I installed an extension to add custom fields to customer registration form.I want to add some option value in dropdown menu box of input validation in backend admin page..could you plz tell me the path of the folder where can I find the phtml file which is responsible for that part ?
-Thanks.
The files you are looking for are in:
app/design/adminhtml/default/default/template
But just changing the .phtml file won't do the job. The customer model itself should be extended to provide for your extra field. Therefore i highly recommend you to write a module for this instead of altering Magento core code. This to make sure that you can still use updates in the future.
Writing such an module requires more in depth knowledge of Magento. For more information on custom adminhtml see here.
For information on extending the core functionality look here.
If you don't feel like programming this all yourself take a look at customer attribute modules on Magento Connect.

deleteing joomla categories from google index

In my site google seems to index categories although I never specifically link to a category - how is that possible such that I can stop it?
This link was never created by me: http://www.website.com/50-categoryname and I want it gone from google for good please.
Thanks,
Mat
You should hide these links from search engines. You can do it in your robots.txt file like this:
Disallow: /50-categoryname
Also take a look at Joomla's Redirect Manager - may it will help you to redirect incorrect links to needed pages.
Even though you think you have never linked the category most likely you have such as by having the category name display in a list or part of a module. Go to configuration fr all your content types and make sure that display/link category and parent category is turned to off and check all modules. Also make sure you don't have any categories links and that you aren't using a sitemap that generates these links automatically (linking to all the top level categories and letting the map build through all of the child categories is the quickest way to generate a site map).

In a custom Joomla! template, how can I determine whether I am on the home page?

I am trying to create a custom template, but I want the template to look a little different for my Joomla! homepage/frontpage. Is there a easy boolean-type expression I can use to determine whether I am on my site's homepage?
That way, I can just say if ($on_homepage) { [custom homepage html] } else { [regular template] }
Thanks in advance!
You can create a separate template for your homepage. More details here.
This is very easy, just create 2 templates. One for your homepage and one for the rest of your site. Then install both, make sure you give them a descriptive name in their xml file so you know the difference.
Once they are installed you can set a default template that would be site wide. Then choose/click on your homepage template and it's options will load up. On the bottom left you can select the menu items where this template will be visible. This setup is very much like the way in which you define where modules are shown.

Resources