Home page top slider how to show in the category page? - magento-1.8

My home page is 1column.phtml and my category page is 2columns-right.phtml. In home page there is a featured slider which is in the path template\eternal\homeslider\slideshow.phtml but I have to show this slider in the category page which is 2columns-right.phtml. How can I do this.
Please help.
Thanks in advance.

You can call featured slider block/phtml in 2columns-right.phtml using check the following condition of category page.
$request = $this->getRequest();
$controller = $request->getControllerName();
if($controller == 'catalog_category_view){
//call your block of slider
}
It will show the slider only in category page.

Related

How to provide dropdown submenus inside one tray menu as below shown in image using pystray library in python?

Here is my sample code:
image = Image.open("E:\\production\\Windows utility tool\\images\\icon.ico")
menu = (item("Sign in", show_window), item("Change status", status_online), item("Change icon", change_icon), item("Open application", open_application), item("Quit", quit_window))
icon = pystray.Icon("Notifer", image, "notifier_application", menu)
icon.run()
See sample image
This is how the menu should be for drop down submenus
menu = (
Item('mainitem1', callable),
Item('mainitem2', callable),
Item('mainitem3', Menu(Item('subitem1', callable),Item('subitem2', callable))),
Item('mainitem4', callable)
)
Make sure to add from pystray import Menu, MenuItem as Item at the beginning of the code.
Hope I gave you a proper answer.

Vaadin 10 Dialog emulating Vaadin 8 Window Caption

Using Vaadin Flow Java API I would like to emulate a Vaadin 8 Window feature: particularly I need to emulate Caption behaviour.
I mean a fixed top "Title" not scrollable as the real content of the Dialog. Anyone can tell me some Example I could learn from ?
Thanks in advance
This is the workaround I found.
public MainView() {
Button button = new Button("Click me",
event -> {
Dialog dialog = new Dialog();
HorizontalLayout horizontalLayout = new HorizontalLayout();
VerticalLayout verticalLayout = new VerticalLayout();
Div headerDiv = new Div();
Div bodyDiv = new Div();
bodyDiv.getElement().getStyle().set("overflow", "auto");
bodyDiv.getElement().getStyle().set("max-height", "420px"); // !!!
dialog.add(headerDiv, bodyDiv);
headerDiv.add(horizontalLayout);
bodyDiv.add(verticalLayout);
horizontalLayout.add(new Label("Hi there !"));
for (int i = 1; i <= 20; i++) {
verticalLayout.add(new TextField("TextField_" + i));
}
dialog.open();
});
add(button);
}
The trouble is that I have to fix max-height size to avoid scrolling of all the contained components. So I cannot take advantage from the auto-size behaviour of the Dialog Container. Also tried using setFlexGrow, but I did not reach the solution.
Any Hint ?
In Vaadin 10+ there is no component called Window, but there is component called Dialog. It does not have Title like Window, but otherwise it has similar baseline. I.e. it is popup. Based on your question you have found already that.
Dialog itself is component container, which means you can add components there. I would just create e.g two Divs (the simplest of the layout components in Vaadin 10). I would style the first one to have fixed height and place the Title there. And then I would apply component.getElement().getStyle().set("overflow", "auto") to the other one, which is the actual content body. The mentioned style will enable the scrollable feature. You could potentially use VerticalLayout / HorizontalLayout instead of Div as well depending what you need.
See also: https://vaadin.com/docs/v10/flow/migration/5-components.html

Configurable XPages ApplicationLayout titlebar tabs: so close, but

I am now getting my tabs in the Application Layout's TitleBar form a view, but it seems that managing the "selected" property is not wotking. Here is the code I have in my page:
<xe:this.titleBarTabs>
<xe:repeatTreeNode indexVar="1" var="tab">
<xe:this.children>
<xe:basicLeafNode label="# {tab.label}"
submitValue="#{tab.label}"
onClick="#{javascript:sessionScope.selectedTab = tab.label;}">
<xe:this.href><![CDATA[#{javascript:
"home.xsp?action=openDocument&documentId=" + tab.unid;}]]>
</xe:this.href>
<xe:this.selected>
<![CDATA[#{javascript:tab.label==sessionScope.selectedTab;}]]>
</xe:this.selected>
</xe:basicLeafNode>
</xe:this.children>
<xe:this.value><![CDATA[#{javascript:getTabs();}]]></xe:this.value>
</xe:repeatTreeNode>
</xe:this.titleBarTabs>
Can this be that hte Href and onClick cannot be there at the same time or I'm just missing something?
As usual, thanks a million for your help. Can't wait to give some back...
You have to decide what shall happen when user clicks a title bar tab:
open URL defined in href
OR
execute onClick event.
The help for onClick gives the hint:
So, you can't use onClick and a scope variable to appear a tab selected after user clicked on tab and new content shows up.
To accomplish this
add an URL parameter &tab= with the tab label tab.label to your href URL
return true in selected code if the current tab label is equal to the tab URL parameter
Your href and selected properties would look like this then:
<xe:this.href><![CDATA[#{javascript:
"home.xsp?action=openDocument&documentId=" + tab.unid + "&tab=" + tab.label}]]>
</xe:this.href>
<xe:this.selected>
<![CDATA[#{javascript:tab.label === param.tab}]]>
</xe:this.selected>
Don't forget to delete the onClick property in your code. You don't need it anymore.
Along the lines of what Knut is suggesting (I think) ... comment out the onClick property for the basicLeafNode and moves its function to the onItemClick for the xe:applicationLayout control.
The code for the onItemClick would be something like this...
var clickedTab = context.getSubmittedValue();
sessionScope.selectedTab = clickedTab;

xamarin.Forms scroll only part of the page

I have a page where I want to have a header always in view at the top and buttons always in view at the bottom. the content in the middle is scrollable.
I thought that this would be easy by doing the following:
StackLayout outer = new StackLayout();
StackLayout inner = new StackLayout();//with all of the content added
ScrollView scroll = new ScrollView();
outer.Children.Add(headerLabel);//non-scrolling
scroll.Content = inner;
outer.Children.Add(scroll); //scrolling
outer.Children.Add(button); //non-scrolling
The headerLabel and the button stay on the corrrect position but the content scrolls right up to the top of the page, over the top of the headerLabel (but beneath/under the button at the bottom).
I am positive it was working correctly but I can't remember changing anything.
Has anyone got any ideas on why this would be happening?
so this fixed it
outer.VerticalOptions = LayoutOptions.End;
and
scroll.IsClippedToBounds=true;

How to fetch the selection of pop-up menu and then zoom out?

How can I fetch the selection of a pop-up menu after the user has selected "his" item and then pressed "Done"?
The selected can be displayed with:
var clicked = document.getElementById("popup").value;
alert(clicked);
And, how can I zoom out, after this item has been selected?
I have put a "ChangeHandler" on the pop-up men
function myChangeHandler(event) {
var clicked = document.getElementById("popup").value;
alert(clicked);
}
BR,
Stefan

Resources