Do we need to import YUI scripts for all pages? - yui

I have a number of list pages and all pages have YUI datatables with menu bar in the page.
If i select a menu item, the corresponding list page will be displayed.
My question is: do we need to import the scripts for all pages, even though the same scripts are used for menu bar?
When I debug the list page from browser it is showing menu bar scripts as well as list page scripts. What can i do?

you can use YUI Loader.

Related

How to scrape different pages of an unchanging Url that pages change with tabs on the top bar of Url?

I want to parse this page 'http://www.tsetmc.ir/Loader.aspx?ParTree=151311&i=22811176775480091' ,but it has a tab_bar on top ,so when I click one of them it shows up new information ,but with the same url.
I am using BeautifulSoup & selenium to parse that but i can't find the tag on the pages that are shown when i click one of the tabs.
This image shows the tabs that i mean.
As far as I could see, this menu uses classes, so you have to write:
driver.find_element_by_css_selector(class="...").click()- with this one he will click on the object with the class name you put into the parentheses.
A small example:
driver.find_element_by_css_selector(class="yellow").click()
The driver would click on the yellow tab, and would open it in the same window.

Liferay 7.0 Modify Navigation Menu for Certain pages

I have a Liferay portal set up for site1.com, I'd like to have a navigation menu for site1.com, and a different menu for any pages under site1.com/mypage.
Bare minimum, would be that all pages under site1.com index the whole site, but all pages under site1.com/mypage only index pages under site1.com/mypage
I've experimented with configuring the Navigation Menu, but I can't seem to get the menu I want on site1.com/mypage, without destroying the menu at site1.com.
My thought is that I should replicate the navigation menu item, call it Navigation Menu-MyPage, and include that at the top of all the site1.com/mypage pages. Is that something that can be done?
I'm new to liferay and not sure where on the file system the Navigation Menu resides (maybe just in the DB?) or how I can copy/rename it.
Or are Application Display Templates the way to go?
Navigation Menu is a built-in portlet that is included on every page by the theme. As you largely specify "Certain Pages", the criteria for your pages could be the use of a common theme: You can build a theme that simply embeds a different Navigation Menu, one that you create by yourself, on each page. Then select this theme for the site you want to use the modified version on.

xpages Tabbed Panel printing

I'm sure I am missing something straightforward and simple, but in xpages, using a tabbed panel, who do I get all the tabs to print when the users prints the page?
You can use a Dojo tab container (part of the extension library) instead of the standard tabbed panel. With the Dojo tab container the content of all tabs is loaded at once (in opposite to the standard tabbed panel, as Tim said), so you could do some CSS magic to make all tabs visible when printing.
Tim recommends building a separate XPage for printing, and I second that. Organize the content of the tabs in custom controls, create a new XPage for example with the suffix "_print" and include the custom controls in it without the tabbed panel. Then create a button, link or whatever in the first XPage which simple opens an XPage with the same name plus "_print" in a new window.
In the "_print" Xpage you can use a "window.print" after the page loads to open the print dialog automatically.
This technique has the advantage that you can style the printing exactly as needed. You can even control which content to include when printing by using the visible/rendered property and compute to render controls only when the current page name does not include "_print".

Google Chrome Extension Development

I am developing a chrome extension that would like to add a tab at the bottom of the page to manipulate DOM elements. Chrome 'manifest.json' file doesn't provide such feature. So how to do it or rather how does Firebug add a tab at the bottom of the Chrome?
I would suggest inserting a panel in every page through a content script. You can style it in order to appear at the bottom of the page and be always visible.
In order for it to retain its state between navigation from one page to another, you need to persist it some how (example use chrome.storage or a similar mechanism through the background page to persist the content (or whatever you need).
See this answer on how to insert (and style) a toolbar-like div or iframe in a page through a content script. (It is fixed to the top of the page, but you can easily modify the code to fix its position at the bottom.)

Joomla menu assignment not working for search page

I have a few modules assigned only for Home page but by some reason they all showing on search page. I don't need any modules showing on search page - how to disable it?
You likely need to make a menu item for the search page. Without a menu item, many pages will revert to the homepage link as the active menu item, which will cause this to happen.
If you haven't already, make a hidden menu for your site and then add the menu item for the search results page to that menu. This way it doesn't affect your main menu.
So first go Menus -> Menu Manager -> Add New Menu. Give it a name basically. (I usually call mine "Hidden".) Then go into that menu and add a menu item like normal for the Search Result type.

Resources