Magento customize catalogsearch result html - php

I'd like to customize the layout for the result page of CatalogSearch.
I'd like to remove the pagination and all other tools on the page and show a much simpler page since we only have few products. Then I need to change how results are displayed to customize the size of images and add a rollover on images.
How can I do that?
By looking at the source code it calls $this->getProductListHtml().

The easiest way to determine which template files to edit, is to enable the "Template Path Hints" in your Magento Configuration.
To do this, do the following:
In your Magento Admin, go to System > Configuration > Developer
On the top left under Current Configuration Scope, select Main Website (or the name of the site you are trying to modify.)
Now on the right, set Template Path Hints to Yes and click Save Config
Go back to your frontend. Each section will now display the exact template you need to modify. NOTE: You should always copy the default template files to your own template directory, instead of modifying Magento's core theme.
Alternately, you can target each page in Magento using CSS. Magento assigns a unique class to each page's <body> tag
In your case, the Catalog Search Results page has a body class of catalogsearch-result-index. If you want to hide the toolbar on that page, you can add the following to your template's style.css file:
.catalogsearch-result-index .toolbar {
display: none;
}

Related

Add php/html file to Wordpress Themes

I am new on wordpress and are using the themes as well. May I know where do I put a new file if let say main.php? I want to make a custom main page and replace the index.php page on the theme. Do I need to put it under htdocs\wordpress\wp-content\themes\<theme-name>. I am using this locally on my computer.
On my main.php, I also include css file. Where do I insert the css file as well?
you can set your front page in wordpress dashboard customization options
Go to Administration > Settings > Reading panel.
and select the page listing in dropdown , but before that you have to create a new page and select you custom page from dropdown . see the below image.
refer this for more info
you can have your css file keep on style directory of your theme and link it in your main page using
get_template_directory_uri() . '/styles/your-style-file.css'
You have to create page template for this.
Have a look over below thread hope this will help you
https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

Adding/Importing a ready coded (AboutUs) page into Joomla

I am busy converting a HTML website into a Joomla temaplate, I got some help doing the home page (index.php), but now the menu items are not linking anywhere. I have a ready coded AboutUs.php page, which I want to important into Joomla and link to the 'About Us' menu item.
Can this be done in the similar way as it is done with the index.php file? Can I maybe upload the file via FTP and link it somehow in Joomla?
Any help on this would be much appreciated.
No it's not how joomla works.
You have to create the second menu item, link it with your content and add the extra modules that your "about us" page have.
If you don't want to do it like that you could create a new template and link each menu to different template but it's not a good approach.
If you are interested about the html part of the php site,
you can just create an article and paste html code in it (do not forget to set the editor in text mode).
If you have css, you may add it int the template's css file.
Otherwise, if you need php functionality, you need to create a joomla component.
If your going to migrate a site and use a tool like joomla i strongly suggest using it the way it was designed to be used. Otherwise theres no point.
When creating from scratch or migrating a site to joomla i would suggest firstly creating (or modifying) one or more templates to get the layout of you site; header, footer, logo, background, modules (eg. menu, login, etc) and component to load and so on.
You will have to recreate the menu items using the menu manager and apply your css to the menu module(you can download free menu modules or use the default one or develop one).
When creating a menu item you can select the template to be used and also what component you want to load (article, sitemap, blog, login, create user, etc...). An article is used to store html content which can be edited through the content manager although there are simple ways to add scripts to your articles.
If you want to add php to your content you have 4 choices.
Template (used to show content which appears on every page; this is where the html starts and ends and where the component and modules' positions are defined),
Component (this is loaded from the template depending on what menu item is selected),
Module (a very simple and easy way to add custom php and html code, can be loaded from the template or from components like in a joomla article),
Plugin (used when wanting to run scripts which dont have any visual content)

How do I edit an individual page in WordPress

I don't want to edit the template files - I'd like to make a new template file. I'm looking in the MySQL registry, but all I see is a table for posts, not pages. Someone mentioned the editor earlier, but that doesn't help with creating new templates.
I think I create a php file in my content>theme>my_theme directory, but I'm not certain.
Thanks for any help.
This should help you out:
It shows you which pages map to which template, and how new templates should be created. As an example, if you created an About Us page (singular, static page with the default page template), here's what Wordpress checks for:
Is there a file called page-about-us.php?
No? Is there a page called page-#.php (where # is the pageid)
No? Just render the generic page.php
In your case, if you want to edit a single page (it's a page right, not post?) .. then simply creating a file called page-$slug.php would be sufficient .. WP will use that "template" when rendering that page.
If it's still a bit unclear, check out the source link here (it makes things crystal clear!): http://make.wordpress.org/docs/theme-developer-handbook/part-one-theme-basics/template-hierarchy/
You can create your own template files in your theme directory, or a subfolder. Use a comment on top that has the name of the template.
/*
Template Name: Custom Template
*/
You can assign the template to a page under the "Page Attributes" box in the dashboard.
Of course you need more than just that comment to display anything in your template. You might stay by copying the content of your theme's index.php, then edit from there.

Wordpress - all pages link to the index.php file

[NEW AT WORDPRESS]
I'm creating my own wordpress theme with own css etc etc. I've managed to get everything good in the index.php file, and I'm trying to make the other pages as well now.
When I make the home.php, blog.php, about.php and contact.php file (in my theme folder) they don't link to it. I'm following the "WordPress 3: Creating and Editing Custom Themes with Chris Coyier" on Lynda.com and the example shows that whenever you make a file with the same name as your page, it takes that directly (which works at his tutorial).
Anyone that could know what is going on?
Example:
I got a file blog.php in my theme folder, and when I go to www.mydomain.com/blog the loaded file is the index.php file, instead of the blog.php file
There are two ways you can get this working using custom page templates.
Create a template for one specific page using the page slug or ID. In this case, change the name of the php files like this to match the name of the page you created in the UI: page-home.php, page-blog.php, page-about.php and page-contact.php
Much more flexible is to create a custom template that can be used on ANY page. Just add the template name to the top of the php file like so (inside the php block):
/*
Template Name: My Home Page Template
*/
Then edit the pages and select your custom template from the template dropdown menu (on the right hand side I think, if its visible).
Reference this page for more info: https://developer.wordpress.org/themes/template-files-section/page-template-files/
Found the solution to my (silly) problem.
Creating a page in your theme directory & adding the template comment at the top of your php file isn't enough. You need to go to the admin panel->pages->YOUR PAGE-> and check out the page attributes. There you can link the page to a certain template: http://d.pr/i/a0m0

How to add a block in magento

I am working on a magento theme but stuck with adding social links in header.
I just want to put three Social links on to my site in header section of every page.
It will depend on the template your using.
The file you'll need to edit will more than likely be in /APP/DESIGN/Somehwere . The somewhere will depend on you the theme you're using.
To see which file you need to edit, turn on template hints: From your admin panel, go to System >> Configuration >> Developer
Depending on your setup, you may have to set it for your default view or a specific store view.
A quick tutorial of template hints is here : http://www.westwideweb.com/wp/2009/08/04/magento-how-to-turn-on-template-path-hints-and-inline-translation/
The base header template is located in:
/app/design/frontend/base/default/template/page/html/header.phtml
But it's not good practice to directly edit this file, while you can do so.
The proper way would be to make a new theme folder, setup your store to use the right theme within admin then to edit the header.phtml file from that theme, which will override the default base theme - eg:
/app/design/frontend/base/yourtheme/template/page/html/header.phtml
make template path hints on for your store view. System->Configuration->Developer. (You can use your specific IP in allowed IPs not to effect the view)
Disable the cache.
Refresh the home page.
You can view the file there, go to that file.
You can directly add it there or you can create a static block and use that in your phtml file according to your wish.

Categories