I want to call a phtml file in a CMS page in magento 1.9:
phtml file path: frontend/base/default/template/inchoo/search
I have created a new cms page in admin and under content wrote this:
{{block type="inchoo/search" name="mycstompage" template="inchoo/search/form.phtml"}}
cleared cache
But when I refresh page it shows nothing. Where I am doing wrong?
Related
I'm having an issue with uploading my website to GitHub pages. I am a beginner and have just made my first website that uses several html files. I have created a repository for this website. The website contains index.html, and 2 other html files. When I first open the website through GitHub Pages it appears to be fine, however if I click on a link on the website which takes me to the main page (the main page being index.html) it opens up a completely different website from my other repository. I realised this is because it uses the same url (username.github.io/index.html) as my other repository. Since both of these are the same I guess it just opens up my other website because it was created earlier.
This is my first issue. I also have another issue. My other 2 html files have a unique html file name, but when I open the link for them I get a 404 error:
"The site configured at this address does not contain the requested file."
From what I understand, a GitHub Pages URL would look like this:
username.github.io/repository name/html file name.
My website looks fine when I open it with this URL:
username.github.io/repository name
However, when I click on any link on the website the URL loses it's repository name and changes into:
username.github.io/html file name which brings up a 404 error.
I don't understand why it does that.
The URLs in your links start with /, which points at the root of the domain.
Don't do that.
I have an existing HTML website. And then Wordpress installed on a separate folder. Wordpress has login, and content .. How can I display the Wordpress login form on my main index.HTML page ? and so once logged in from home, it would redirect to the Wordpress logged in sections ???
You should be using an index.php instead of an index.html file. That will allow you to use WordPress functions outside of WordPress. That would then allow you to put <?php wp_login_form(); ?> wherever you want the form to go.
Otherwise you'll have to copy the HTML output of the current login form and paste it into the html file.
I've just got my website up and when I only type in the domain I get an Index of all the files that I've uploaded, but I want it to load my HTML page when it gets loaded as www.domain.com/domain.html instead I want it to be www.domain.com.
How do I do this? Do I have to contact my hosters or can I do this in the project?
As long as the web server doesn't use wacky configuration, you can just name the main file "index.html" and it will be the main access point to your domain.
Please keep index.html file in top level directory of application. If you do not have index.html file then add new file in top level directory and redirect it using onLoad function to your website home page.
All you have to do is to rename domain.html to index.html and it will be displayed automatically when the site loads.
That is the main page you wish to display when someone visits www.domain.com should be named index.html if it is an html page, if not you use the correct file extension.
A way to keep using domain.html as the main source file. Create an index.html file and add the following code in it.
<script>
setTimeout(function(){
window.location='domain.html';
}, 5000);
</script>
I tried making a GH-Page for my AngularJS project http://cmittle.github.io/ptcalc1/, from my repo https://github.com/cmittle/ptcalc1. When I load the GH-Page I see the index.html. The header and footers are stored in separate html files and do not load. I've used the ng-view AngularJS directive to load the content of the tabs from other html files and the url changes accordingly, but the html pages do not load.
The code works when launched from either Brackets or Netbeans.
It doesn't look like you have a gh-pages branch for that repo.
Go to the settings tab in that repo, then options, and click 'Launch automatic page generator'. Alternatively, you can create the gh-page yourself, just read read the docs on how to do so.
Web sites built by the simple way often have a main html document that the html code is written in it.
If a user right clicks on the browser and select "view page source" then the name : "Example.html" will appear as page source.
That file then can be found in the web site's root directory.
My question is : what about joomla? Where is that main file?
What if I want to put some code in the page that I see on the front end, where do I do that?
Joomla doesn't contain any html files for displaying content, the only html files you will find are blank.
Joomla uses 2 index.php files. There is one in the template folder where all the HTML, CSS and Javascript is pushed to and the other is in the root of your Joomla site where all applications get pushed to one loaded.
When you view the page source code for a Joomla site, you are simply viewing the structure that has been pushed to the index.php file from various locations, such as from modules and components.
Update
Ok, I think this might be best done in the index.php file of your template. First, in the Joomla backend, get the ID of the menu item that link to the page that you wish to use for your code. Once done, add the following code to the index.php:
<?php
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$menu = $app->getMenu()->getActive()->id;
if ( $menu == 1) { // change 1 to the ID that you got from the Menu Manager
$doc->addStyleDeclaration('
//css goes here
');
$doc->addScriptDeclaration('
//javascript code goes here
');
?>
<p>hello world</p>
<?php
}
?>