In Navigation, possibility for page as Parent Navigation Item for other pages? - pencilblue

Through the admin GUI I want to use a page as Parent Navigation Item for a set of other pages. Instead of a Container.
Is there a way to make this possible?

First, you would have to create a plugin that overrides the dropdown template, since Bootstrap doesn't have clickable dropdowns in the navbar by default.
Then you would want the plugin to override the navigation form to show the Link field when navItem.type is "container".
Lastly, your plugin would need its own getBootstrapNav function, preferably in a custom service, that would inject the link into the dropdown item.

Related

Liferay 7.3: How to make menu items in a theme controlled by admin

I have a liferay theme for version 7.3. I am facing one problem in the theme's menu.
Now menu has some static items. How can I change (add / remove) items dynamically by admin account?
The menu is added in /src/templates/portal_normal.ftl as
<#include "${full_templates_path}/menu-bar.ftl" />
this file has static html data.
Now how can I make it dynamic so that admin can change the menu items?
Make the menu as a web content, and drag it to the theme? Not makes sense because menu is the part of the theme.
Or any other way of picking the menu items, looping the items in .ftl and display it?
The times of scripting navigation and menus in the theme are over, and I'd rather recommend to embed a portlet in your theme that does the job. That might be a stock NavigationMenu portlet (see how Liferay's default "classic theme" does this with NavigationMenu or the SearchBar), or a custom one, which generates exactly what you'd like.
Reason: It's a lot simpler to redeploy a new portlet and generate/test appropriate HTML markup generation in a portlet than it is to implement proper error handling in a theme's freemarker script.
The solution can be if you want to add your data in navigation menu in themes, go into the navigation menus inside site builder in menu and create a new menu by clicking + button on top right and name the menu. Then go into the pages inside site builder inside menu. There will be a + sign on public pages. Click that and add a page that you want to list. If you want to create a submenu then on the page that is created, create a subpage by clicking there + sign. The page will be child and will be shown as a sub menu in theme.

Is it possible to attach event on the *opening* of the context menu?

I am developing a WebExtension and as you know it is impossible to inject content script on chrome://* pages and https://chrome.google.com/webstore/*. I have a buttons in a context menu and for correct UX I would like to drop my item from context menu on such protected page.
According to the documentation I can handle click on my context menu item, but looks like no way to check the url of the page on the moment of right mouse click without trying to inject content script into every page?
As a workaround I have a code that checks url after click to the menu item.

changing styleclass and disableoutputtag on panels within a facet using themes

I am not an expert on themes but i would like to know if it is possible to accomplish that:
Once i pull a panel into a facet i am hiding the panel by disabling the output tag and setting a special css class only for the designer client.
Has somebody tried to do that automatically in themes by checking if the panel is in a facet(Maybe ask for the key: property)?
I have tried to change the panel but i dont know how to set a certain style class based on a property of the panel.
To my best knowledge: A theme styles content rendered, not attributes that define if content gets rendered or not.
You have 2 options you could use:
create your own little extension library with controls you want to use everywhere. Add one 'containerPlaceholder' (or whatever you would call it) that doesn't render any own output, but only it's children.
use a snippet you simply paste into your source code.
don't use a panel or div, but add your custom controls to the callbacks. Makes your XPage more readable (that's what I do)
Hope that helps

JSF Primefaces:redirect to specific page on p:tab click

I would like to utilize p:tabView for horizontal site menu.
When tab is clicked,that user should be redirected in non-ajax style to the specific page.
Is it possible to inject to each tab (e.g. inside p:tab tag) href link ?
Or there is already some alternative to it?
You could put the p:tabView in a template and set the activeIndex property according to the view ID of the current page. It's an ugly hack, but certainly do-able. I did something similar, using a p:menu on the left for navigation in the control panel section of my site.
Primefaces 3.4 now has a p:tabMenu component that may be of use.
You will have to manage the active tab manually since this is an undeveloped feature.

How can I present a library as a custom view?

I have a Sharepoint library that is currently rendering as the usual folder and document items table list view.
I would like to use present the same information as a grid of folder and document icons with some nice jQuery hover animations to show tooltips on the item the icon represents.
I suppose what I am really trying to find out is how to add a new library view that allows me to specify the markup rendered per item. I could write a new webpart to query the list and use an ASP:Repeater but I don't want to have to specify a webpart property each page to tell the webpart where it should open the list from.
You can use List View Web Part with custom XSLT.

Resources