Orchard Navigation - how to make menu link not clickable - orchardcms

I have following menu navigation:
home
product
product 1
product 2
news
press releases
about us
Every menu item above links to a Content, except "product".I need to make it so when the user click "product" would not go anywhere.
I tried to use "Custom Link", and enters "#" or "javascript:void(0)" in the url, however that does not work since Orchard always prefix the url with "/".
Also, I tried to use "Html Menu Item" and enter "product" in the html body, but always rendered as
<li><span class="raw"><p>product</p></span><ul>...</ul></li>
I want either following:
<li>product<ul>....</ul></li>
or
<li>product<ul>....</ul></li>
Is there an easy way to do this?

In the Menu.cshtml file under the Core->Shapes->Views directory in the Orchard.Web project, you could do this:
$(document).ready(function () {
$("#Nav a").click(function(e) {
e.preventDefault();
});
});
The above disables clicking on all of your menu links, so if you want to prevent clicking on the second level menu items:
$('#Nav li ul li a').click(function(e){
e.preventDefault();
});
That Menu.cshtml file is the view for your navigation menu, so you can define it's behavior as you wish there. You can look at this answer of mine as well.

You may do as Mohammad says, but create an alternate Menu.cshtml in your Theme. It is bad practise to modify Orchards core code.

Related

Jumping to a specific id section on a different page

I am creating a portfolio project using handlebars and nodeJS. On my home(index) page, I have two sections down the page called 'about me' and 'contact me'. My nav bar also contains two buttons labeled 'about me' and 'contact me'. Both my 'contact me' and 'about me' have id tags with corresponding names.
I understand that when on the home page already, I can simply use
About Me
and this will automatically scroll down the page for me.
However, my issue is when I am not on the home page, but say one of my project pages. They also have the same nav bar, so if I want to click on 'contact me', simply using
About Me
it will obviously not work because that page does not contain the section with that id.
So my question is, if I am on a project page and I click on the 'contact me'/'about me' button in the nav bar, how do I get back to the home page and then also have it scroll down to those sections?
From this link, https://www.sitepoint.com/community/t/how-do-i-link-jump-to-a-specific-section-on-a-different-page/5646 I was hoping to get answers. But since I am using handlebars instead of html, this option does not work for me.Or at least I do not think it does.
I have my hbs all stored in a folder called views. The index.hbs is in /public/views. However my project pages are store in /public/views/partials <-- just for reference.
Thanks in advance!

how do I add “contact page or custom link” at top menu bar in OpenCart?

how do I add “contact page or custom link” at top menu bar in OpenCart?
i am using Version 2.1.0.2
how can i add "homepage and other page" at responsive menu in opencart?
Thanks
I generally add it to the header.tpl file which is in catalog/view/theme/{name of theme}/template/common/header.tpl
and look for the li item that corresponds to where you want to add the menu and add it in by adding a new line with the code
<li>{Name of Menu Item}</li>
Go to
catalog/view/theme/default/template/common/header.tpl
Add Following line before ul close, it may around line number 115.
<li>Contact Us<li>
On my opencart v2.3.0.2,
I just need to add new Links (contact page) at OC CMS Block (index.php?route=extension/module/occmsblock/cmslist&token=) then choose type as Link, fill links column to "index.php?route=information/contact", then after it created, just edit horizontal megamenu (in my theme) and add those new link (contact page) and it will be displayed at header.

How to hide View in Browser in document library in sharepoint 2010 using javascript or jquery

I had integrated Office Web Apps in sharepoint 2010. When Document is selected from document Library in context menu I want to hide Option View in Browser and Edit in Browser Option from Document Library.
Is is possible using jquery or javascript If yes can any tell me how ?
I used following css to hide but it only hide Delet option not View in Browser Option
li.ms-MenuUIULItem[text~=Delete]
{
display: none;
}
So I also Modified it as follows
li.ms-MenuUIULItem[text~=View in Browser]
{
display: none;
}
It also didn't work.
Can anyone help me for that ?
It is better to do it with features than doing it with javascript.
You have to create a feature with a HideCustomAction element in it.
The element structure is like this:
<HideCustomAction
GroupId = "[GroupId]"
HideActionId = "[HideActionId]"
Id = "...."
Location = "....">
</HideCustomAction>
And here is a link that will help you find your required actions Id:
http://www.sharepointarchitects.us/johnholliday/post/0001/01/01/how-to-find-customaction-identifiers/
I have created it using jquery
$(document).ready(function(){
$('.ms-MenuUIPopupBody').live('blur', function() {
var elm = $("div.ms-MenuUIULItem a:contains('View in Browser')");
elm.remove();
$("div.ms-MenuUIULItem a:contains('Edit in Browser')").remove();
});
});
It is hiding menu only on focus or blur or mouseover
I wants it to be hide on load AS soon as i Click on "V" option on right side of document it should hide View in Browser and Edit in browser
When I click on V option ![I wants As soon as i Click on v option right side of test it should hide view in Browser and edit in browser][1]

Liferay: How to fetch the first 3 items from an asset publisher?

In Liferay I have used the asset publisher to publish news on my news page. I want to fetch the 3 top news from the page and embed it into another page. How can I do this? The page URL containing the news links looks like the following:
Liferay.Widget({ url: 'http://test.com/testnews/101_INSTANCE_f22'});
Liferay itself has a property where one can share an asset publsiher instance any where else on a site, but that is not exactly what I want. So any help or guidance is appreciated. Thanks.
If you want only links then you can set display style 'title-list' (this will take you to the article on the main news page).
if you want to open the link in another page, change asset link behavior to 'View in a specific portlet'.
You can change the look of asset publisher to whatever design you want. follow the path look & feel --> advanced styling --> Copy the portlet id. Now by using mozilla firefox pick the class,tags,etc. and write your css code. This will override the basic design. E.g.
#p_p_id_101_INSTANCE_8f5JPIxv8ml0_ .asset-abstract {
width: 25%;
float: left;
}
Is there a particular reason why you don't want to configure another AssetPublisher on the second page? You can just use the identical configuration, but limit the number of results shown to 3 - done.
Problem solved. Here is the solution with jQuery:
$.get('http://test.com/news/', function(data) {
var top3links = $(data).find('a:lt(3)');
$('#top3').html(top3links); // });

CKEditor 3.x add text to dialog

I disabled the advanced & target tabs from the link dialog, and only left the URL input box.
Actually what I did is exactly explained here: http://peterpetrik.com/blog/remove-tabs-and-elements-from-ckeditor-dialog-window
My question is, is it possible to add a text string to the dialog (as my supplement hints for users.) ?
Yes, you can use " add(elementDefinition, nextSiblingId) ", to add elements to the dialog.
From the code on the page in your link, I added "infoTab.add" before the "infoTab.remove" entries:
infoTab.add(
{
type : 'html',
html : '<div id="myDiv">Supplemental <b>hint</b>.</div><br />'
},
'linkType'
);
// Remove unnecessary widgets from the 'Link Info' tab.
infoTab.remove( 'linkType');
infoTab.remove( 'protocol');
The nextSiblingId is used to place the new element above an existing element.
I assigned "linkType" as nextSiblingId to place the new element above the url input box.
To place the new element between the url input box and the browse button, replace 'linkType' with 'browse' ( 'browse' is the id assigned to the browse button in the definition for the link dialog ).
To place the new element below the button, just remove ( , 'linkType' ).
Between this information and that found on the page you linked to, you should be able to accomplish your goal.
If you want to get a better understanding of your options, you can look at the following files:
The source files for the link dialog:
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_plugin.js.html
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_dialogs_link.js.html
http://docs.cksource.com/ckeditor_api/symbols/src/plugins_link_dialogs_anchor.js.html
The source files are also in your CKEditor directory:
ckecitor/_source/plugins/link/
The CKEditor documentation is located here:
http://docs.cksource.com/
Some relevant info from the CKEditor API:
CKEDITOR.dialog
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html
CKEDITOR.dialog.definition.html
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.html.html
CKEDITOR.dialog.definitionObject
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definitionObject.html
CKEDITOR.dialog.definition.contentObject
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.contentObject.html
Be Well,
Joe

Resources