Situation: I have old site Agroteplica based on Joomla 2.5. I need to add custom html-code to menu items (for example, icons, or bold). I need unic icon for each menu item, so it's no use to edit php-template of page.
If I try to use html-code in menu item header - Joomla clear it, only text remains. I tried to find some manuals, and added line filter="raw" to file modules.xml:
<field name="title" type="text"
description="COM_MODULES_FIELD_TITLE_DESC"
label="JGLOBAL_TITLE"
maxlength="100"
required="true"
filter="raw"
size="35"
/>
But it didn't give any effect either.
Question: what I need to do to make it work? :)
Here is what Joomla provides for cases like this:
In Menu Manager -> Menu Item Edit
Editing each menu item, you will see the "Link Type Options" section at the right column.
See screenshot:
As you see in the screenshot, this group of settings contains the follow options:
Link Title Attribute : You can add your custom Title attr to the menu item's a tag.
Link CSS Style : You can add a custom css class for this menu item's a tag.
Link Image : You can add a custom image for this menu item.
Add Menu Title : If you add an image, you can choose to hide the Title of the link (setting = No), or choose to show both Image and the title (setting = yes (default)).
For you case, you can either choose you custom images-icons that should be displayed next to your menu items title. If you want bolds or other styling options, you can add your custom css rules to the items you want, and then add your css styles at your template's css.
For example you have decided that for some of your menu-items you would want their text in bold. Then you could do as follow:
1 .Give them a css class to all of them, in the Link CSS Style field: e.g. 'bold-items' (without the '').
2. Open your template's css file with a plain text editor and add the following rule at the end of the document:
.bold-items {
font-weight:bold;
}
Notice: The above settings might have no effect at all, if you are using a 3rd party menu module, or your template contains overrides for the default menu module. In such case you will need to add further template overrides for the menu module in use, in order to implement the above settings.
*Not sure what you mean with menu item header and how you did try to add html-code to it.
*Update / Answer to your comment:
You never mentioned about video in your question. You asked about adding icons and making text bold. What do you mean with headers and what kind of code and where are you trying to insert it? Are you aware of what is involved in the process from the moment you create menu items in the menu manager till you see those in the front-end of your website?
Following my answer above and assuming you have basic knowledge of the workflow (menu module, template overrides, css) you will be able to add images/icons or custom styles for each menu item. If you want to have video inside your menu, then you...
... will need a more sophisticated menu module. These are called Mega Menus and allow the user to display various types of content inside their menus, like modules, in various ways. You should either install a such module or create one on your own.
Related
I am developing a wordpress theme. In the "Menus" there is a section:
How can I add an item to this programmatically? is it possible?
Update:
If that is not possible, how can I add "icon" and "open in new tab" options.
I've searched a lot but didn't find anything. Can anybody introduce a source?
You can enable the Link Target and CSS Classes options from the Screen Options avaible in the top-right of the menu admin area. Link Target is a checkbox that provides the option to Open link in a new tab. CSS Classes is a text-field that you can use to add your custom CSS class. You can then display your icon using CSS.
How do you have a completely different look for each category in magento 2 (custom category layouts), in magento 1.* I know you could change the template either checking for the page layout or changing the template in the custom layout update via xml however magento 2 doesn't let you change templates in here?
I tried following http://www.magestore.com/magento-2-tutorial/how-to-design-a-custom-magento-2-category-page-template/ but didn't really understand how it worked.
Magento 2 seems much more difficult to get my head around than the previous version so any help is greatly appreciated.
You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file.
For detail :
http://sumankc.com/2016/12/10/different-template-for-different-categories-in-magento-2-category_id-layout-handle-in-m2/
GO To admin -> Manage Category and select particular category that you want different design and ther is one tab "custom design" . in this tab there is one drop down list with name "custom design". you can select custom design for perticular category.
Here are the steps that you will follow in this Magento 2: Change category page layout
On the Admin page, look for Product section. Then click on Categories section under Inventory.
You can see the category tree on the left, choose any category for which you want to change the page layout.
Then find the Custom design section, click on it.
Now you can change both category page layout and custom theme here.
In this section, you can use 2 fields to change the category page layout. The Page Layout and Custom Layout Update.
Page Layout field gives you 6 options to change the category layout.
The Custom Layout Update allows you to update the theme layout with XML code.
These are the options for changing category page layout.
I am pretty experienced with wordpress but having a hard time modifying some areas of Joomla templates,
the template is,
http://demo.joomla-monster.com/177-jm-web-development
I have already installed it and can access it administration area but I couldn't be able to find the area where I can modify the footer links , or slide show images under "our latest releases..." heading or the news in the left widget.
I have looked under Extensions -> Template Manager to modify the widget or footer but there is no such option.
Can anyone guide me ?
Your template has a position, see what position is the element that you want to edit.
http://demo.joomla-monster.com/177-jm-web-development
Look for the module in this position and edit it (for the banner). Menu footer likely to be edited in the "MENU", module in this position only displays menu items.
basic joomla https://docs.joomla.org/Portal:Administrators
You can also find the module position by adding ?tp=1 to the end of your URL. For example, if you are looking to edit a module and not sure what position it is just go to http://www.yoursite.com/?tp=1 and it will outline the name of your module positions.
To edit the footer links directly, if you go to menus, there should be a menu called "Footer Links" or something like that. You can modify/create links there.
I need to redirect the user to a specific page by placing a hyperlink just before a closing </ul> tag (which is within a WordPress sidebar widget).
An example of what I am trying to achieve can be found below, using the WooCommerce Products widget which has been slightly modified to include an additional Specials hyperlink:
I am using the WooCommerce 2.9.1 plugin, and believe that the file I need to modify is the
class-widgets-products.php file. This file is made up with the following code - http://pastebin.com/vgpSqa6X.
On line 178 I have placed the following, which will display a hyperlink taking the user to a Specials page on the website:
echo '» Specials';
However, with this particular widget, it creates three separate instances and this will apply the hyperlink to All Products, Featured Products and On-sale Products.
How can I create separate hyperlinks that will apply to the widget, depending on which option has been selected in the admin menu?
For example, if the Featured Products option has been selected, it will output a Featured Products hyperlink at the bottom, and if the On-sale option has been selected, it will output a Specials hyperlink at the bottom.
Thank you.
The answer seems to lie in :
$this->settings->show->options
or :
$this->settings['show']['options']
...as the code you have pasted suggests.
Just evaluate this value with if's (or switches, whatever you feel comfortable with) :
if ($this->settings['show']['options'] == "this_particular_kind")
{
$link_at_the_bottom = '» This Particular Kind';
}
...
I would like to hack headway theme by adding an option to pages to append custom "classes" for that particular page. It's similar to your regular page where you have an option to select page template. but instead of selecting page template user would just have to select the class he/she wanted to append on the page. that class will have a CSS overide.
Example:
HTML
<body class=" red ...other headway css classes..." ">
CSS
body.red #container { background: red }
body.green #container { background: green }
I want to add a custom dropdown that list some classes option for theme to choose. example item on the dropdown. "red theme", "blue theme". This can also be done using Custom field but prefred to use dropdown so user won't get it wrong.
Append the class that was selected on the page to the tag of that page. I tried using "body_class" on my functions.php But It totally erased all the classes causing my page to break appart. What I wanted to do is just append the custom class instead of erasing the entire classes of the body.
Please advice. thanks!
Headway already has a custom meta box for custom classes on a page, so maybe you could either:
hack that to display a drop down
create some sort of meta box that will save a selection from a drop down to the same field that Headway writes to, if that's possible, and just remove/hide the Headway meta box from the admin
add an informational box on the page screen that displays the available classes and just use the Headway meta box instead (upgrade safe, best approach to keep things clean)