OpenCart: Add home to menu and remove from header - opencart

I was wondering what is the best way to remove Home from the header and place Home in the menu?
Should it be done only in the custom theme, default theme, or both?
I have in the past done:
Edit:
catalog/view/theme/mytheme/template/common/header.tpl
located:
<div id="menu">
<ul>
and added:
<li><?php echo $text_home; ?></li>
I am unsure though if it is better to modify the default theme instead of the custom theme. Any advise would be great.

This only needs to be done in your custom theme. You don't need to do this in the default theme unless your theme uses the default template for the header (and in that case you really should still duplicate the header file from default to your theme and edit that)
EDIT
Open /catalog/view/theme/your-theme-name/template/common/header.php to find the text. Will usually look something like
<?php echo $text_home; ?>
Remove that and save the file

Related

Sphinx Readthedocs theme Font-awesome integration

I know this may be a very silly question, but I've not managed to find anything online about a potential solution.
I am using Sphinx 1.4 and the sphinx_rtd_theme to generate some documentation for my Django project. I've been trying to find a way to use font-awesome icons in the .rst files but have found no way to do it. I've had a look at the sphinx_rtd_theme source files and the fa-* icons are included in the theme.css file. However, I'm unaware of a way actually to have them included.
Is it a directive, interpreted text or anything similar? I've tried icon, fonticon and fa as either of the above and none worked.
Any help would be appreciated.
I know I can potentially use raw HTML, but I'd like to avoid that if at all possible.
You can use Sphinx's rst-class directive, as follows:
.. rst-class:: fa fa-fontawesome
the font awsome flag will be attached to this paragraph
rst-class will set the class attribute for the next element as specified.
The following code renders only the icon:
.. rst-class:: fa fa-font-awesome
|
Of course, you can also use custom classes to further style the element.
You can also use https://sphinx-panels.readthedocs.io/en/latest/#inline-icons:
:fa:`bars`
:fa:`spinner,text-white bg-primary fa-2x,style=fa`
I am just learning Sphinx and had the same question, but using raw HTML is fine for my case. Maybe this solution will be helpful to someone out there...
In the conf.py file, add a link to your Fontawesome Kit Code URL
html_js_files = [
'https://kit.fontawesome.com/##########.js',
]
Then, use fontawesome icons in Sphinx with the raw HTML directive
.. |fa-fort-awesome| raw:: html
<i class="fab fa-fort-awesome"></i>
Here is some text |fa-fort-awesome| with the icon in the middle.
Here is how it renders as HTML...
In order to make the icons available on HTML and Latex download FontAwesome Web Package from https://fontawesome.com/download, include font-awesome/svgs/solid into your project _static folder and make use of image directives like bellow:
The |fa-bars| function is to toggle the left Sidebar Menu between being collapsed behind the button or displayed on the screen.
.. |fa-bars| image:: _static/font-awesome/svgs/solid/bars.svg
:width: 20px
:alt: hamburguer button
Results:
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
The <i class="fa fa-bars"></i> function is to toggle the left Sidebar Menu between being collapsed behind the button or displayed on the screen.

Joomla Proper CMS for complex design

i am very confused right now. I came from Wordpress,and laravel frameworks, and now i am assigned to develop Joomla! project.I thought i can easily manage to create custom template in joomla. I have been reading a lot of articles and documentation. I've manage to create a template and display modules.
But now, i need to start digging the right way to display the content and manage it in Joomla! back-end.
Here's my problem. I have home page (Long page) and inner pages (Short page). Here's the structure of my homepage
<html>
... header links and other necessary tags
<body>
<section class="homepageonlysection1">
<div>
image and text here! (i made this as 1 modules in Custom HTML)
</div>
<div>
video here (i made this as 1 modules in Custom HTML)
</div>
</section >
<section class="homepageonlysection2">
<div>
form here (i made this as 1 modules in Custom HTML)
</div>
<div>
image and text here! (i made this as 1 modules in Custom HTML)
</div>
</section>
<section class="homepageonlysection3">
<div>
image and text here! (i made this as 1 modules in Custom HTML)
</div>
<div>
video here (i made this as 1 modules in Custom HTML)
</div>
</section>
</body>
</html>
and this is my inner pages
<html>
... header links and other necessary tags
<body>
<section class="innerpagessectiononly1">
<div>
Article Content (i will do as jdoc:inlucde type="component")
</div>
</section>
<section class="innerpagessectiononly2">
<div>
sidebar Content (i will do this as 1 modules in Custom HTML)
</div>
</section>
</body>
</html>
Those template are really different.
Problem 1 : How can i make my inner pages if my homepage structure is very different? Or
Problem 2 :How can i make display my section (homepageonlysection) in home page only and display (innerpagessectiononly) in inner pages only?
Problem 3 : Is there a Advance Custom Field (ACF for wordpress) as joomla extension ?
Please advice. Any help would be appreciated.
One thing I recommend is really digging into the core templates (both front and backend) to understand how things work. In particular Isis the backend template illustrates a number of complex options.
Now, overall I think you probably do not want to do the homepage the way you are doing it, since it will be very inflexible and hard to change. On the other hand it's possible that you want it inflexible and hard to change. In reality you may not need to have separate layouts at all or the differences may be minimal and may not require any special code at all.
So, first, this document explains how to determine if you are on the home page. So you can clearly pretty easily test for that and then enclose your two separate designs in the true and false conditions. This is basically what you see in Isis. In your case you can place one or more module position inside the condition. In fact you could make it so this layout does not even load a component. Then you can just make an empty article and make the home page a single article link to that empty article. (I would put that article into a separate landing page category)
A second option if you really want to have a totally different design on the home page is to make a totally separate template for the home page. If say you called this "my home template" and your other template "my everywhere else template" what you could do is make "my everywhere else template" the default and then on the default (homepage) menu item assign the "my home template" template. In this special template you can even use the module jdoc:include (instead of modules) to call specific modules in highly customized ways. I would suggest you go read the docs on that. You can even set the options and the chrome right in the template.
However, I think you are missing a key feature of Joomla. In your question you have not said what kind of menu link you are planning to use for your home page. The third option is that for the homepage you use the same template but a specific alternate layout that you use for this page. For your case what you would most likely want to do, assuming that you are not using the featured articles layout type anywhere else (i.e. that no articles are marked featured), is to make your homepage using an articles > featured menu link. Then you can assign all the modules you made to the home page via the menu modules tab. Depending on how your module positions are in the template it could just be that they will float up.
Your design is not a particularly unusual or complex however. Many Joomla homepages consist of multiple structured sections of text and media. These are made with menu types such as "featured" and "category blog." The advantage of using these menu types is that then you are storing your content in articles and these are much easier to manage. ALso you don't have to give someone access to the module manager in order to allow them to edit these snippets of content. So the fourth and possibly best approach is to use one of these standard content layouts. For example if you were to make a category called "home page content" and then put the content for each of the modules in a separate article and (assuming you want a consistent structure) put the image for each of them into the structured intro text image field, you can then make a "category blog" menu link to the "home page content" category as you default (home page) menu link. Then what you can do is make one or more layout override for those individual items that gives the exact layout you want. Assuming that they are all the same, you can select that as a alternate layout in your menu link. Actually even if they are not all the same you can just do a more complex layout instead of looping through the list and doing the same thing for each article, do each one separately.
A fifth approach is to use an alternative layout instead of an alternate layout. The difference there is that you would give the layout a new name (in either the category or featured view) and then you will have the additional flexibility of being able to create options in the menu link that are different than those for the normal category/featured views. It's up to you to decide what you might want to add there.
There are other options as well, because Joomla has a very strong template community and they like to have a lot of flexibility. But that will get you started.

different templates - how to connect via landing page to next layout

I am developing a site for a friend of mine. The startpage should only contain her name, a slogan and a link (something like Enter Site) to the next template. I can't figure out on how this can be accomplished.
So, briefly, the startpage should NOT contain menu items, the next template which would be called from the link "enter site" would contain ALL the menu items and the relevant information..
I have searched thru various discussion groups, but can't find an answer. Site is being build around Joomla CMS 3.2.3
URL is (for development purposes) www.webmatix.be/nikie
Can someone throw in a helping hand?
Tnx + b rgds
Gino
there are various ways to achieve this. I guess that Joomla wants you to assign a different template to the home menu item. You can do this in extensions - templates. If you click on the template there is an option somewhere to add it to menu pages. So in fact you have to make 2 templates then. This is not what I prefer.
I always do it using PHP in my template's index.php. I ask for the menu's alias and then fix the template accordingly:
<?php
$currentMenuItem = JSite::getMenu()->getActive();
$alias = $currentMenuItem->alias;
?>
<?php if($alias == "home"): ?>
<div>homepagestuffs</div>
<?php else: ?>
<div>normal template with all kinds of modules and components bla</div>
<?php endif; ?>
This gives me the flexibility I want without having a second template to worry about.
Ignoring for a moment the negative effect on user experience, why not just create an index.html in the root directory of the website and only if necessary adjust the .htaccess to promote it before index.php for just that directory.
e.g.
DirectoryIndex index.html index.php
You can make a HTML file like index.html and do what ever you want in that.
Place index.html in the root folder of your host.
Then make a folder and give it name like "dynamic" or whatever you want.
Copy the whole Joomla Website files in that folder.
The URLs would be like:
http://www.example.com/index.html
http://www.example.com/dynamic/index.php
I've one use this solution in rasoularam.com
The first page (landing page):rasoularam.com, pure HTML, Javascript, CSS
The other pages: http://rasoularam.com/dynamic/index.php/%D8%A8%DB%8C%D9%88%DA%AF%D8%B1%D8%A7%D9%81%DB%8C-%D8%B1%D8%B3%D9%88%D9%84-%D8%A2%D8%B1%D8%A7%D9%85.html
Do't worry about unfamiliar characters in the url, they are uni-code urls, written in persian.
The benefit of this solution is that, because of using pure html page as landing page, the first page will load fast, even the host does not have good hardware configuration.
The only problem is the administrator section's url would be rasoularam.com/dynamic/administrator

Custom Font in Maximenu CK - which css file to change?

On my Joomla 2.5 site, I set up a menu with Maximenu CK. I have the plugin Maximenu params, too, for easy styling. I am using the blank theme for a horizontal menu.
Problem: I wasn't able to apply a custom Google font though. More specifically: which css to change?
I tried to track down the location with Firebug, but found that the font-definition was inline in my main html. I guess this is done with php and include, but don't know where to look further.
I have never worked with Google custom fonts but this is how I was able to change Maximenu CK's font family to a usual font like Palatino, Arial or Tahoma:
From Joomla root directory I navigated to modules/mod_maximenuck/themes/blank/css which I assume is the directory containing blank theme's styling files.
Within the css directory, I found the following files: ie7.css, index.html,maximenuhck.php, maximenuhck_rtl.php, maximenuvck.php, moo_maximenuhck.css, moo_maximenuhck_rtl.css and moo_maximenuvck.css.
I was able to change menu font by updating maximenuhck.php
Here is the portion of code to which I added my preferred font family (starts at line 12):
/* menu */
div#<?php echo $id; ?> {
font-size:14px;
line-height:21px;
text-align:left;
}
I hope this is helpful.
One way to do it would be to treat this the same as for any other text on the page which you wish to style.
In the head of your template bring in the font file, e.g.
<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet" type="text/css">
Using firebug check the class of menu and target anchor tags inside that menu with CSS which you add to your site CSS file, e.g.
.maximenuCKH a{
font-family: 'Open Sans Condensed', sans-serif;
}
You might have to tweak the selector to suit your needs, but this will hopefully get you started.

Blogger, tumblr option for custom template

How these application allow users to upload their own templates? How is this possible?
Do they have some kind of a their own template engine or..?
Tumblr gives you two options to include your own theme:
If it is just for personal use: by changing the html of the theme. If you go to your tumblr-website and click on the customize button, you can edit the html. In the header file the content of your .css must be pasted between the <style type="text/css"> </style> tags. And you can add some javascript there. For the html I suggest to read the manual that Mirko Adari suggested: Tumblr Theme manual
If you want it to be a theme on itself: submit your theme to the Theme Garden: Tumblr Theme Garden
Blogger is a bit more rigid. Also there you can change your html file. Keep in mind that it's markup for posts is different then Tumblr. Also custom CSS files can be added (more information on that). If you are less familiar with css and html Blogger offers some buttons so that you can change the basics to your own needs. Blogger also offers a way to backup and restore your theme. A more detailed explanation can be found here. This template file must be an .xml file. More information on the markup of this xml-template can be found here.